This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/go-fsnotify/fsnotify" | |
) | |
// main | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"path/filepath" | |
"github.com/go-fsnotify/fsnotify" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"archive/tar" | |
"compress/gzip" | |
"crypto/md5" | |
"fmt" | |
"io" | |
"os" | |
"path/filepath" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Untar takes a destination path and a reader; a tar reader loops over the tarfile | |
// creating the file structure at 'dst' along the way, and writing any files | |
func Untar(dst string, r io.Reader) error { | |
gzr, err := gzip.NewReader(r) | |
if err != nil { | |
return err | |
} | |
defer gzr.Close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tar takes a source and variable writers and walks 'source' writing each file | |
// found to the tar writer; the purpose for accepting multiple writers is to allow | |
// for multiple outputs (for example a file, or md5 hash) | |
func Tar(src string, writers ...io.Writer) error { | |
// ensure the src actually exists before trying to tar it | |
if _, err := os.Stat(src); err != nil { | |
return fmt.Errorf("Unable to tar files - %v", err.Error()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/nanobox-io/golang-scribble" | |
) | |
// a fish | |
type Fish struct{ Name string } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package commands | |
import ( | |
"os" | |
"path/filepath" | |
"strings" | |
"time" | |
"github.com/spf13/cobra" | |
"github.com/spf13/viper" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"github.com/nanopack/hoarder/commands" | |
) | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package commands | |
import ( | |
"fmt" | |
"github.com/spf13/cobra" | |
"github.com/spf13/viper" | |
) | |
var ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# boxfile.yml | |
run.config: | |
engine: ruby | |
# add extra packages | |
extra_packages: | |
- nodejs | |
- nginx | |
# |
OlderNewer