checksum: Use constant mapping for checksum types #170

Merged
dstepanov-yadro merged 1 commit from aarifullin/frostfs-sdk-go:fix/checksum_enum into master 2023-09-29 09:50:04 +00:00

View file

@ -24,17 +24,17 @@ type Checksum refs.Checksum
// Type represents the enumeration // Type represents the enumeration
// of checksum types. // of checksum types.
type Type uint8 type Type refs.ChecksumType
const ( const (
// Unknown is an undefined checksum type. // Unknown is an undefined checksum type.
Unknown Type = iota Unknown Type = Type(refs.UnknownChecksum)
// SHA256 is a SHA256 checksum type. // SHA256 is a SHA256 checksum type.
SHA256 SHA256 = Type(refs.SHA256)
// TZ is a Tillich-Zémor checksum type. // TZ is a Tillich-Zémor checksum type.
TZ TZ = Type(refs.TillichZemor)
) )
// ReadFromV2 reads Checksum from the refs.Checksum message. Checks if the // ReadFromV2 reads Checksum from the refs.Checksum message. Checks if the