Documentation
¶
Index ¶
- Variables
- func CopyFileToTarStream(stream *tar.Writer, path string, header *tar.Header) error
- func JSONMarshal(input interface{}) ([]byte, error)
- func LoadLicenseFiles(filename string, targz io.Reader, prefixFilters ...string) (map[string][]byte, error)
- func SanitizeDockerName(name string) string
- func TargzIterate(filename string, targz io.Reader, fn func(*tar.Reader, *tar.Header) error) error
- func TempDir(dir, prefix string) (name string, err error)
- func ValidatePath(path string, shouldBeDir bool, pathDescription string) error
- func WriteToTarStream(stream *tar.Writer, data []byte, header tar.Header) error
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultLicensePrefixFilters for LoadLicenseFiles, NOTICE and LICENSE DefaultLicensePrefixFilters = []string{"LICENSE", "NOTICE"} )
Functions ¶
func CopyFileToTarStream ¶
CopyFileToTarStream writes a file to a tar stream
func JSONMarshal ¶
JSONMarshal marshals an arbitrary map to JSON; this only exists because JSON.Marshal insists on having maps that have string (and not interface{}) keys
func LoadLicenseFiles ¶
func LoadLicenseFiles(filename string, targz io.Reader, prefixFilters ...string) (map[string][]byte, error)
LoadLicenseFiles iterates through a tar.gz file looking for anything that matches prefixFilters. Filename is for error generation only.
func SanitizeDockerName ¶
SanitizeDockerName makes a string conform with the rules for Docker names
func TargzIterate ¶
TargzIterate iterates over the files it finds in a tar.gz file and calls a callback for each file encountered. Filename is only used for error generation.
func TempDir ¶
TempDir overrides the default TempDir, since Docker needs this to be in your user folder.
func ValidatePath ¶
ValidatePath validates that a path (file or dir) exists
Types ¶
This section is empty.