Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NormalizeChecksum ¶ added in v0.3.4
NormalizeChecksum trims whitespace and an optional sha256: prefix.
func NormalizeOid ¶ added in v0.3.4
NormalizeOid strips an optional "sha256:" prefix, lowercases, and validates that the result is a 64-character hex string. Returns "" for invalid input.
Types ¶
type ChecksumType ¶
type ChecksumType string
ChecksumType represents the digest method used to create the checksum
const ( ChecksumTypeSHA1 ChecksumType = "sha1" ChecksumTypeSHA256 ChecksumType = "sha256" ChecksumTypeSHA512 ChecksumType = "sha512" ChecksumTypeMD5 ChecksumType = "md5" ChecksumTypeETag ChecksumType = "etag" ChecksumTypeCRC32C ChecksumType = "crc32c" ChecksumTypeTrunc512 ChecksumType = "trunc512" )
IANA Named Information Hash Algorithm Registry values and other common types
func NormalizeChecksumType ¶
func NormalizeChecksumType(raw string) ChecksumType
func (ChecksumType) String ¶
func (ct ChecksumType) String() string
type HashInfo ¶
type HashInfo struct {
MD5 string `json:"md5,omitempty"`
SHA string `json:"sha,omitempty"`
SHA256 string `json:"sha256,omitempty"`
SHA512 string `json:"sha512,omitempty"`
CRC string `json:"crc,omitempty"`
ETag string `json:"etag,omitempty"`
}
func (*HashInfo) UnmarshalJSON ¶
UnmarshalJSON accepts both the DRS map-based schema (Indexd) and the array-of-checksums schema (GA4GH).
Click to show internal directories.
Click to hide internal directories.