Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Archive ¶
func (*Archive) BinaryChecksum ¶
BinaryChecksum retrieves checksum value of binary in archive. Returned value is base64-encoded []byte. TODO: maybe we should just return string(checksumSHA256(binary))?
type ArchiveChecksum ¶
func (*ArchiveChecksum) MarshalJSON ¶
func (c *ArchiveChecksum) MarshalJSON() ([]byte, error)
func (*ArchiveChecksum) UnmarshalJSON ¶
func (c *ArchiveChecksum) UnmarshalJSON(b []byte) error
type Base ¶
type Base struct { Overlay map[string]map[string]string `json:"overlay,omitempty"` Name string `json:"name"` Version string `json:"version"` }
Base is a minimal structure which exists in every program variations
type ChecksumCalculator ¶
type ChecksumCalculator struct {
// contains filtered or unexported fields
}
ChecksumCalculator calculates checksum by passing in data through io.Writer
func (*ChecksumCalculator) Error ¶
func (c *ChecksumCalculator) Error(expect []byte) error
Error compares the Base64 encoded checksum
type Config ¶
type Config struct { Base Checksums map[string]string `json:"checksums"` Provider string `json:"provider"` Path string `json:"path"` }
Config is a program declaration in configuration file (default: bindl.yaml)
type Lock ¶
type Lock struct { Base Checksums map[string]*ArchiveChecksum `json:"checksums,omitempty"` ChecksumSrc string `json:"checksum,omitempty"` URLTemplate string `json:"url"` }
Lock is a configuration used by lockfile to explicitly state the expected validations of each program.
func (*Lock) ArchiveName ¶
ArchiveName returns the archive name with OS and Arch interpolated if necessary, i.e. someprogram-linux-amd64.tar.gz. This reads from URL and assumes that contains the archive name.
func (*Lock) DownloadArchive ¶
func (p *Lock) DownloadArchive(ctx context.Context, d download.Downloader, goOS, goArch string) (*Archive, error)
DownloadArchive returns Archive which has the archive data in-memory, with guarantees on archive checksum. That is, if checksum fails, no data will be made available to caller.