Move version and signature structures to refs package

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-08-20 12:43:47 +03:00 committed by Stanislav Bogatyrev
parent f1addc4cc5
commit db12420c99
16 changed files with 363 additions and 86 deletions

View file

@ -26,6 +26,14 @@ type Checksum struct {
type ChecksumType uint32
type Signature struct {
key, sign []byte
}
type Version struct {
major, minor uint32
}
const (
UnknownChecksum ChecksumType = iota
TillichZemor
@ -129,3 +137,59 @@ func (c *Checksum) SetSum(v []byte) {
c.sum = v
}
}
func (s *Signature) GetKey() []byte {
if s != nil {
return s.key
}
return nil
}
func (s *Signature) SetKey(v []byte) {
if s != nil {
s.key = v
}
}
func (s *Signature) GetSign() []byte {
if s != nil {
return s.sign
}
return nil
}
func (s *Signature) SetSign(v []byte) {
if s != nil {
s.sign = v
}
}
func (v *Version) GetMajor() uint32 {
if v != nil {
return v.major
}
return 0
}
func (v *Version) SetMajor(val uint32) {
if v != nil {
v.major = val
}
}
func (v *Version) GetMinor() uint32 {
if v != nil {
return v.minor
}
return 0
}
func (v *Version) SetMinor(val uint32) {
if v != nil {
v.minor = val
}
}