Documentation ¶
Index ¶
- func CopySingleFileTGZContent(dst io.Writer, tgzContentReader io.Reader) error
- func ResolveArtifact(locatorWithResolver LocatorWithResolverParam, defaultResolvers []Resolver, ...) error
- func ResolveArtifactTGZ(locatorWithResolver LocatorWithResolverParam, defaultResolvers []Resolver, ...) error
- func SHA256ChecksumFile(fPath string) (string, error)
- type Locator
- type LocatorParam
- type LocatorWithResolverParam
- type PathChecksummer
- type Resolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopySingleFileTGZContent ¶
CopySingleFileTGZContent verifies that the TGZ content provided by the reader consists of a tar archive that contains a single regular file and writes the content of that file to the provided writer. Returns an error if the tar archive does not contain a single file (if it contains greater or fewer files or contains non-file entries).
func ResolveArtifact ¶
func ResolveArtifact(locatorWithResolver LocatorWithResolverParam, defaultResolvers []Resolver, osArch osarch.OSArch, dst string, checksummer PathChecksummer, stdout io.Writer) error
ResolveArtifact retrieves the artifact specified by the provided locator and OSArch, writes it to the provided destination path and verifies its integrity if a checksum is provided. If the provided locator specifies a resolver, it will be used to retrieve the artifact; otherwise, the default resolvers will be used in order. If the locator specifies a checksum for the provided OSArch, then it will be used to verify the downloaded artifact using the provided hasher to compute the hash for the path. Returns an error if the artifact could not be resolved using the resolvers or if a checksum was provided and did not match. Note that, if the function resolves an artifact to the destination, the artifact will not be removed even if the function returns an error (for example, due to checksums not matching).
func ResolveArtifactTGZ ¶
func ResolveArtifactTGZ(locatorWithResolver LocatorWithResolverParam, defaultResolvers []Resolver, osArch osarch.OSArch, dst string, stdout io.Writer) error
ResolveArtifactTGZ executes ResolveArtifact for an artifact that is known to be a TGZ that contains a single file. The checksum for the artifact is computed by computing the checksum of the file that is in the TGZ archive (rather than the TGZ archive itself).
func SHA256ChecksumFile ¶
Types ¶
type Locator ¶
func (Locator) GroupAndProductString ¶
type LocatorWithResolverParam ¶
type LocatorWithResolverParam struct { LocatorWithChecksums LocatorParam Resolver Resolver }