Documentation ¶
Index ¶
- Constants
- func AddPathToZip(path string, ignoreGlobs []string, w *zip.Writer) error
- func CopyToReader(r io.Reader) (br *bytes.Reader, err error)
- func FieldName(parent, field string) string
- func IsLocal(u *url.URL) bool
- func LoadConfigFile(fn string, v interface{}) (err error)
- func LocalOrRemoteReader(u *url.URL) (rc io.ReadCloser, size int64, err error)
- func ReadConfigFile(fn string) (b []byte, err error)
- func ReadLocalOrRemoteFile(fn string) (b []byte, err error)
- func ReaderAtToReader(r io.ReaderAt, size int64) io.Reader
- func SaveConfigFile(fn string, data interface{}) (err error)
- func ZipAppend(filename string, files []ZipData) error
- func ZipAppendFromReader(r io.ReaderAt, size int64, files []ZipData) (io.Reader, error)
- func ZipFiles(filename string, files []ZipData) error
- type ZipData
Constants ¶
const StuccoConfigEnv = "STUCCO_CONFIG"
StuccoConfigEnv is a name of environment variable that will be checked for stucco.json path if one is not provided
Variables ¶
This section is empty.
Functions ¶
func AddPathToZip ¶
AddPathToZip appends contents of directory to zip, optionaly skipping files/directories matching gitignore like lines
func CopyToReader ¶
CopyToReader returns new bytes.Reader with a copy of data read by r
func LoadConfigFile ¶
LoadConfigFile returns Config from file
func LocalOrRemoteReader ¶
LocalOrRemoteReader creates a closable reader from url
func ReadConfigFile ¶
ReadConfigFile loads stucco config from json or yaml file.
If extension is provided function loads config directly, otherwise it tries .json, .yaml and .yml extensions.
func ReadLocalOrRemoteFile ¶
ReadLocalOrRemoteFile loads file from local storage or http depending on scheme in url
func ReaderAtToReader ¶
ReaderAtToReader returns a reader backed with ReaderAt
func SaveConfigFile ¶
SaveConfigFile saves config to file
func ZipAppendFromReader ¶
ZipAppendFromReader appends data to existing zip archive overwritting files that match name