Documentation ¶
Index ¶
- func EqualChecksums(cs1, cs2 *Checksum) bool
- func IsSupportedVersion(v *Version) error
- type Checksum
- func (c *Checksum) Marshal(b ...[]byte) ([]byte, error)
- func (c *Checksum) MarshalJSON() ([]byte, error)
- func (c *Checksum) Parse(s string) error
- func (c *Checksum) SetSHA256(v [sha256.Size]byte)
- func (c *Checksum) SetTillichZemor(v [64]byte)
- func (c *Checksum) String() string
- func (c *Checksum) Sum() []byte
- func (c *Checksum) ToV2() *refs.Checksum
- func (c *Checksum) Type() ChecksumType
- func (c *Checksum) Unmarshal(data []byte) error
- func (c *Checksum) UnmarshalJSON(data []byte) error
- type ChecksumType
- type Signature
- func (s *Signature) Key() []byte
- func (s *Signature) Marshal(b ...[]byte) ([]byte, error)
- func (s *Signature) MarshalJSON() ([]byte, error)
- func (s *Signature) SetKey(v []byte)
- func (s *Signature) SetSign(v []byte)
- func (s *Signature) Sign() []byte
- func (s *Signature) ToV2() *refs.Signature
- func (s *Signature) Unmarshal(data []byte) error
- func (s *Signature) UnmarshalJSON(data []byte) error
- type Version
- func (v *Version) Major() uint32
- func (v *Version) Marshal(b ...[]byte) ([]byte, error)
- func (v *Version) MarshalJSON() ([]byte, error)
- func (v *Version) Minor() uint32
- func (v *Version) SetMajor(val uint32)
- func (v *Version) SetMinor(val uint32)
- func (v *Version) String() string
- func (v *Version) ToV2() *refs.Version
- func (v *Version) Unmarshal(data []byte) error
- func (v *Version) UnmarshalJSON(data []byte) error
- type XHeader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EqualChecksums ¶
func IsSupportedVersion ¶
IsSupportedVersion returns error if v is not supported by current SDK.
Types ¶
type Checksum ¶
Checksum represents v2-compatible checksum.
func NewChecksum ¶
func NewChecksum() *Checksum
NewVersion creates and initializes blank Version.
Works similar as NewVersionFromV2(new(Version)).
func NewChecksumFromV2 ¶
NewChecksumFromV2 wraps v2 Checksum message to Checksum.
func (*Checksum) Marshal ¶
Marshal marshals Checksum into a protobuf binary form.
Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.
func (*Checksum) MarshalJSON ¶
MarshalJSON encodes Checksum to protobuf JSON format.
func (*Checksum) SetTillichZemor ¶
SetTillichZemor sets checksum to Tillich-Zemor hash.
func (*Checksum) UnmarshalJSON ¶
UnmarshalJSON decodes Checksum from protobuf JSON format.
type ChecksumType ¶
type ChecksumType uint8
ChecksumType represents the enumeration of checksum types.
const ( // ChecksumUnknown is an undefined checksum type. ChecksumUnknown ChecksumType = iota // ChecksumSHA256 is a SHA256 checksum type. ChecksumSHA256 // ChecksumTZ is a Tillich-Zemor checksum type. ChecksumTZ )
type Signature ¶
Signature represents v2-compatible signature.
func NewSignature ¶
func NewSignature() *Signature
NewSignature creates and initializes blank Signature.
Works similar as NewSignatureFromV2(new(Signature)).
func NewSignatureFromV2 ¶
NewSignatureFromV2 wraps v2 Signature message to Signature.
func (*Signature) Marshal ¶
Marshal marshals Signature into a protobuf binary form.
Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.
func (*Signature) MarshalJSON ¶
MarshalJSON encodes Signature to protobuf JSON format.
func (*Signature) UnmarshalJSON ¶
UnmarshalJSON decodes Signature from protobuf JSON format.
type Version ¶
Version represents v2-compatible version.
func NewVersion ¶
func NewVersion() *Version
NewVersion creates and initializes blank Version.
Works similar as NewVersionFromV2(new(Version)).
func NewVersionFromV2 ¶
NewVersionFromV2 wraps v2 Version message to Version.
func SDKVersion ¶
func SDKVersion() *Version
SDKVersion returns Version instance that initialized to current SDK revision number.
func (*Version) Marshal ¶
Marshal marshals Version into a protobuf binary form.
Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.
func (*Version) MarshalJSON ¶
MarshalJSON encodes Version to protobuf JSON format.
func (*Version) UnmarshalJSON ¶
UnmarshalJSON decodes Version from protobuf JSON format.
type XHeader ¶
XHeader represents v2-compatible XHeader.
func NewXHeader ¶
func NewXHeader() *XHeader
NewXHeader creates, initializes and returns blank XHeader instance.
func NewXHeaderFromV2 ¶
NewXHeaderFromV2 wraps v2 XHeader message to XHeader.