Documentation ¶
Index ¶
- Constants
- Variables
- func Cache2Disk(command, cacheScope, src string, cacheMaxSizeInMB int64) error
- func Compress(src, dst string, files []*FileInfo) error
- func Decompress(src, dst string) error
- func MD5All(root string) (map[string]string, error)
- func Unzip(src string, dest string) ([]string, error)
- func Zip(source, target string) error
- type FileInfo
- type SDError
- type SDStore
Constants ¶
const CompressFormatTarZst = ".tar.zst"
const CompressFormatZip = ".zip"
const CompressionLevel = -3 // default compression level - 3 / possible values (1-19) or --fast
const DefaultFilePermission = os.ModePerm
const Md5Extension = ".md5"
const ZstdCli = true // use zstd binary or go library
Variables ¶
var ExecCommand = exec.Command
ExecCommand : os exec command
var FlockWaitMaxSecs = 15
var FlockWaitMinSecs = 5
var UTCLoc, _ = time.LoadLocation("UTC")
Functions ¶
func Cache2Disk ¶ added in v0.0.39
cache directories and files to/from shared storage param - command set, get or remove param - cacheScope pipeline, event, job param - src source directory param - cacheMaxSizeInMB max cache size limit allowed in MB return - nil / error success - return nil; error - return error description
func Decompress ¶ added in v0.0.64
func MD5All ¶ added in v0.0.7
MD5All reads all the files in the file tree rooted at root and returns a map from file path to the MD5 sum of the file's contents. If the directory walk fails or any read operation fails, MD5All returns an error. In that case, MD5All does not wait for inflight read operations to complete.
func Unzip ¶ added in v0.0.6
Unzip is repurposed from https://github.com/mholt/archiver/pull/92/files To include support for symbolic links
func Zip ¶ added in v0.0.18
Zip is repurposed from https://github.com/mholt/archiver/pull/92/files To include support for symbolic links
Types ¶
type SDError ¶
type SDError struct { StatusCode int `json:"statusCode"` Reason string `json:"error"` Message string `json:"message"` }
SDError is an error response from the Screwdriver API