Documentation ¶
Index ¶
- Variables
- func CopyDir(to, src string) error
- func CopyFile(to, src string) error
- func FilterWalk(srcDir, filter string, since, until time.Time) ([]string, error)
- func FindInInterface(iface interface{}, mapKeys ...string) (interface{}, error)
- func GetShell() (string, error)
- func InterfaceToJSON(mapVar interface{}) ([]byte, error)
- func IsInRange(target, since, until time.Time) bool
- func JSONToFile(JSON []byte, outFile string) error
- func SplitFilepath(path string) (dir string, file string)
- func TarGz(sourceDir string, destFileName string) error
- func WriteJSON(iface interface{}, filePath string) error
Constants ¶
This section is empty.
Variables ¶
var ErrNoShellOnWindows = errors.New("shell{} is not supported on Windows. please use command{}")
ErrNoShellOnWindows occurs when GetShell() is run on a Windows machine.
var ErrUnknownShell = errors.New("unable to determine shell from environment. please set the $SHELL environment variable")
ErrUnknownShell occurs when the $SHELL environment variable is empty or not set.
Functions ¶
func FilterWalk ¶
FilterWalk accepts a source directory, filter string, and since and to Times to return a list of matching files.
func FindInInterface ¶
FindInInterface treats an interface{} like a (nested) map, and searches through its contents for a given list of mapKeys. For example, given an interface{} containing a map like iface ~ interface{}{"top": {"mid": {"bottom": "desired_value"}}} one could fetch an interface{} of "desired_value" with FindInInterface(iface, "top", "mid", "bottom") then afterwards cast it to a string, or whatever type you're expecting.
func GetShell ¶
GetShell returns the value of the $SHELL environment variable, or an error if on Windows or the variable is not set.
func InterfaceToJSON ¶
InterfaceToJSON converts an interface{} to JSON.
func JSONToFile ¶
JSONToFile accepts JSON and an output file path to create a JSON file.
func SplitFilepath ¶
SplitFilepath takes a full path string and turns it into directory and file parts. In particular, it's useful for passing into seekers.NewCopier()
Types ¶
This section is empty.