Documentation ¶
Index ¶
- func EqualChecksums(cs1, cs2 *Checksum) bool
- 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 ¶
Types ¶
type Checksum ¶
Checksum represents v2-compatible checksum.
func NewChecksum ¶
func NewChecksum() *Checksum
NewChecksum creates and initializes blank Checksum.
Works similar as NewChecksumFromV2(new(Checksum)).
Defaults:
- sum: nil;
- type: ChecksumUnknown.
func NewChecksumFromV2 ¶
NewChecksumFromV2 wraps v2 Checksum message to Checksum.
Nil refs.Checksum converts to nil.
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) ToV2 ¶
ToV2 converts Checksum to v2 Checksum message.
Nil Checksum converts to nil.
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 )
func (*ChecksumType) FromString ¶ added in v1.28.0
func (m *ChecksumType) FromString(s string) bool
FromString parses ChecksumType from a string representation. It is a reverse action to String().
Returns true if s was parsed successfully.
func (ChecksumType) String ¶ added in v1.28.0
func (m ChecksumType) String() string
String returns string representation of ChecksumType.
String mapping:
- ChecksumTZ: TZ;
- ChecksumSHA256: SHA256;
- ChecksumUnknown, default: CHECKSUM_TYPE_UNSPECIFIED.
type Signature ¶
Signature represents v2-compatible signature.
func NewSignature ¶
func NewSignature() *Signature
NewSignature creates and initializes blank Signature.
Works similar as NewSignatureFromV2(new(Signature)).
Defaults:
- key: nil;
- signature: nil.
func NewSignatureFromV2 ¶
NewSignatureFromV2 wraps v2 Signature message to Signature.
Nil refs.Signature converts to nil.
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) ToV2 ¶
ToV2 converts Signature to v2 Signature message.
Nil Signature converts to nil.
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)).
Defaults:
- major: 0;
- minor: 0.
func NewVersionFromV2 ¶
NewVersionFromV2 wraps v2 Version message to Version.
Nil refs.Version converts to nil.
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.
Defaults:
- key: "";
- value: "".
func NewXHeaderFromV2 ¶
NewXHeaderFromV2 wraps v2 XHeader message to XHeader.
Nil session.XHeader converts to nil.
Directories ¶
Path | Synopsis |
---|---|
Package netmap provides routines for working with netmap and placement policy.
|
Package netmap provides routines for working with netmap and placement policy. |