Documentation ¶
Index ¶
- Variables
- func ConvertStringSliceToMap(values []string) map[string]string
- func DefaultEnv(key string, _default string) string
- func FileInfoStat(fi os.FileInfo) *syscall.Stat_t
- func GetUIDGID() (int, int, error)
- func IsSpecialFile(fi os.FileInfo) bool
- func IsValidJSON(blob []byte) bool
- func MergeEnv(envList []string, newEnvMap map[string]string) []string
- func MergeStringMaps(mapOne, mapTwo map[string]string) map[string]string
- func MergeStructMaps(mapOne, mapTwo map[string]struct{}) map[string]struct{}
- func Min(a int64, others ...int64) int64
- func Must(condition bool, message string, arguments ...interface{})
- func ResolveChown(chown string) (uid, gid int, err error)
- type MultiErrors
Constants ¶
This section is empty.
Variables ¶
var BuildHash string
BuildHash is a variable that will be populated at build-time of the binary via the ldflags parameter. It is used to break cache when a new version of makisu is used.
Functions ¶
func ConvertStringSliceToMap ¶
ConvertStringSliceToMap parses a string slice as "=" separated key value pairs, and returns a map.
func DefaultEnv ¶
DefaultEnv returns the environment variable <key> if it is found, and _default otherwise.
func FileInfoStat ¶
FileInfoStat provides a convenience wrapper for casting the generic FileInfo.Sys field.
func IsSpecialFile ¶
IsSpecialFile returns true for file types that overlayfs ignores. Overlayfs logic:
#define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m))
func IsValidJSON ¶ added in v0.1.6
IsValidJSON returns true if the blob passed in is a valid json object.
func MergeEnv ¶
MergeEnv merges a new env key value pair into existing list. This is needed because Docker image config defines Env as []string, but actually uses it as map[string]string.
func MergeStringMaps ¶
MergeStringMaps merges two string maps and returns the combined map. If there are duplicate keys it picks value from second map.
func MergeStructMaps ¶
MergeStructMaps merges two struct maps and returns the combined map. If there are duplicate keys it picks value from second map.
func Must ¶
Must ensures that the condition passed in is true. If condition is true this function NO-OPS; Otherwise it logs the message formatted with the arguments passed in
func ResolveChown ¶ added in v0.1.11
ResolveChown converts a chown string to uid and gid integers. Format: <user>[:<group>] Both <user> and <group> can be either user/group strings or uid/gids. If <group> is not specified, gid will be set to the resolved uid.
Types ¶
type MultiErrors ¶
MultiErrors contains a list of errors. It supports adding and collecting errors in multiple threads.
func NewMultiErrors ¶
func NewMultiErrors() *MultiErrors
NewMultiErrors returns a new MultiErrors obj.
func (*MultiErrors) Collect ¶
func (e *MultiErrors) Collect() error
Collect returns the result error.