sdstore

package
v0.0.71 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2023 License: BSD-3-Clause Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const CompressFormatTarZst = ".tar.zst"
View Source
const CompressFormatZip = ".zip"
View Source
const CompressionLevel = -3 // default compression level - 3 / possible values (1-19) or --fast
View Source
const DefaultFilePermission = os.ModePerm
View Source
const Md5Extension = ".md5"
View Source
const ZstdCli = true // use zstd binary or go library

Variables

View Source
var ExecCommand = exec.Command

ExecCommand : os exec command

View Source
var FlockWaitMaxSecs = 15
View Source
var FlockWaitMinSecs = 5
View Source
var UTCLoc, _ = time.LoadLocation("UTC")

Functions

func Cache2Disk added in v0.0.39

func Cache2Disk(command, cacheScope, src string, cacheMaxSizeInMB int64) error

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 Compress added in v0.0.64

func Compress(src, dst string, files []*FileInfo) error

func Decompress added in v0.0.64

func Decompress(src, dst string) error

func MD5All added in v0.0.7

func MD5All(root string) (map[string]string, error)

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

func Unzip(src string, dest string) ([]string, error)

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

func Zip(source, target string) error

Zip is repurposed from https://github.com/mholt/archiver/pull/92/files To include support for symbolic links

Types

type FileInfo added in v0.0.61

type FileInfo struct {
	Path    string `json:"path"`
	Size    int64  `json:"size"`
	ModTime int64  `json:"modtime"`
	Mode    string `json:"mode"`
}

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

func (SDError) Error

func (e SDError) Error() string

Error implements the error interface for SDError

type SDStore

type SDStore interface {
	Upload(u *url.URL, filePath string, toCompress bool) error
	Download(url *url.URL, toExtract bool) error
	Remove(url *url.URL) error
}

SDStore is able to upload, download, and remove the contents of a Reader to the SD Store

func NewStore

func NewStore(token string, maxRetries int, httpTimeout int, retryWaitMin int, retryWaitMax int) SDStore

NewStore returns an SDStore instance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL