Documentation ¶
Overview ¶
Package checksum implements methods for obtaining and verifying the checksum of binary files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // FileSha256 is a hash table the storage the checksum of the binary files. It is parsed from 'version/components.json'. FileSha256 = map[string]map[string]map[string]string{} )
Functions ¶
This section is empty.
Types ¶
type Checksums ¶
type Checksums struct {
// contains filtered or unexported fields
}
Checksums is a list of checksums.
func NewChecksums ¶
NewChecksums returns a new Checksums.
type HTTPChecksum ¶
type HTTPChecksum struct { FileName string // contains filtered or unexported fields }
HTTPChecksum is a checksum that is downloaded from a URL.
func NewHTTPChecksum ¶
NewHTTPChecksum returns a new HTTPChecksum.
func (*HTTPChecksum) Get ¶
func (h *HTTPChecksum) Get() error
Get downloads the checksum file and parses it.
func (*HTTPChecksum) SetHost ¶
func (h *HTTPChecksum) SetHost(host string)
SetHost sets the host of the URL.
func (*HTTPChecksum) SetPath ¶
func (h *HTTPChecksum) SetPath(pathStr string)
SetPath sets the URL path of the binary.
func (*HTTPChecksum) Value ¶
func (h *HTTPChecksum) Value() string
Value returns the checksum value.
type InternalChecksum ¶
type InternalChecksum struct { ID string Version string Arch string // contains filtered or unexported fields }
InternalChecksum is the internal checksum implementation.
func NewInternalChecksum ¶
func NewInternalChecksum(id, version, arch string) *InternalChecksum
NewInternalChecksum returns a new internal checksum implementation given the binary information.
func (*InternalChecksum) Get ¶
func (i *InternalChecksum) Get() error
Get gets the internal checksum.
func (*InternalChecksum) Value ¶
func (i *InternalChecksum) Value() string
Value returns the internal checksum value.
type StringChecksum ¶
type StringChecksum struct {
// contains filtered or unexported fields
}
StringChecksum is a simple checksum implementation for given strings.
func NewStringChecksum ¶
func NewStringChecksum(value string) *StringChecksum
NewStringChecksum returns a new StringChecksum for the given string.
func (*StringChecksum) Get ¶
func (s *StringChecksum) Get() error
Get the StringChecksum Get() method will do nothing.
func (*StringChecksum) Value ¶
func (s *StringChecksum) Value() string
Value returns the value of the StringChecksum.