pkg

package
v1.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 6 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualChecksums

func EqualChecksums(cs1, cs2 *Checksum) bool

Types

type Checksum

type Checksum refs.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

func NewChecksumFromV2(cV2 *refs.Checksum) *Checksum

NewChecksumFromV2 wraps v2 Checksum message to Checksum.

Nil refs.Checksum converts to nil.

func (*Checksum) Marshal

func (c *Checksum) Marshal(b ...[]byte) ([]byte, error)

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

func (c *Checksum) MarshalJSON() ([]byte, error)

MarshalJSON encodes Checksum to protobuf JSON format.

func (*Checksum) Parse added in v1.22.0

func (c *Checksum) Parse(s string) error

Parse parses Checksum from its string representation.

func (*Checksum) SetSHA256

func (c *Checksum) SetSHA256(v [sha256.Size]byte)

SetSHA256 sets checksum to SHA256 hash.

func (*Checksum) SetTillichZemor

func (c *Checksum) SetTillichZemor(v [64]byte)

SetTillichZemor sets checksum to Tillich-Zemor hash.

func (*Checksum) String added in v1.22.0

func (c *Checksum) String() string

func (*Checksum) Sum

func (c *Checksum) Sum() []byte

Sum returns checksum bytes.

func (*Checksum) ToV2

func (c *Checksum) ToV2() *refs.Checksum

ToV2 converts Checksum to v2 Checksum message.

Nil Checksum converts to nil.

func (*Checksum) Type

func (c *Checksum) Type() ChecksumType

Type returns checksum type.

func (*Checksum) Unmarshal

func (c *Checksum) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of Checksum.

func (*Checksum) UnmarshalJSON

func (c *Checksum) UnmarshalJSON(data []byte) error

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

type Signature refs.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

func NewSignatureFromV2(sV2 *refs.Signature) *Signature

NewSignatureFromV2 wraps v2 Signature message to Signature.

Nil refs.Signature converts to nil.

func (*Signature) Key

func (s *Signature) Key() []byte

Key sets binary public key.

func (*Signature) Marshal

func (s *Signature) Marshal(b ...[]byte) ([]byte, error)

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

func (s *Signature) MarshalJSON() ([]byte, error)

MarshalJSON encodes Signature to protobuf JSON format.

func (*Signature) SetKey

func (s *Signature) SetKey(v []byte)

SetKey returns binary public key.

func (*Signature) SetSign

func (s *Signature) SetSign(v []byte)

SetSign sets signature value.

func (*Signature) Sign

func (s *Signature) Sign() []byte

Sign return signature value.

func (*Signature) ToV2

func (s *Signature) ToV2() *refs.Signature

ToV2 converts Signature to v2 Signature message.

Nil Signature converts to nil.

func (*Signature) Unmarshal

func (s *Signature) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of Signature.

func (*Signature) UnmarshalJSON

func (s *Signature) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes Signature from protobuf JSON format.

type Version

type Version refs.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

func NewVersionFromV2(v *refs.Version) *Version

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) Major

func (v *Version) Major() uint32

Major returns major number of the revision.

func (*Version) Marshal

func (v *Version) Marshal(b ...[]byte) ([]byte, error)

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

func (v *Version) MarshalJSON() ([]byte, error)

MarshalJSON encodes Version to protobuf JSON format.

func (*Version) Minor

func (v *Version) Minor() uint32

Minor returns minor number of the revision.

func (*Version) SetMajor

func (v *Version) SetMajor(val uint32)

SetMajor sets major number of the revision.

func (*Version) SetMinor

func (v *Version) SetMinor(val uint32)

SetMinor sets minor number of the revision.

func (*Version) String

func (v *Version) String() string

func (*Version) ToV2

func (v *Version) ToV2() *refs.Version

ToV2 converts Version to v2 Version message.

Nil Version converts to nil.

func (*Version) Unmarshal

func (v *Version) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of Version.

func (*Version) UnmarshalJSON

func (v *Version) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes Version from protobuf JSON format.

type XHeader

type XHeader session.XHeader

XHeader represents v2-compatible XHeader.

func NewXHeader

func NewXHeader() *XHeader

NewXHeader creates, initializes and returns blank XHeader instance.

Defaults:

  • key: "";
  • value: "".

func NewXHeaderFromV2

func NewXHeaderFromV2(v *session.XHeader) *XHeader

NewXHeaderFromV2 wraps v2 XHeader message to XHeader.

Nil session.XHeader converts to nil.

func (*XHeader) Key

func (x *XHeader) Key() string

Key returns key to X-Header.

func (*XHeader) SetKey

func (x *XHeader) SetKey(k string)

SetKey sets key to X-Header.

func (*XHeader) SetValue

func (x *XHeader) SetValue(k string)

SetValue sets value of X-Header.

func (*XHeader) ToV2

func (x *XHeader) ToV2() *session.XHeader

ToV2 converts XHeader to v2 XHeader message.

Nil XHeader converts to nil.

func (*XHeader) Value

func (x *XHeader) Value() string

Value returns value of X-Header.

Directories

Path Synopsis
acl
id
Package netmap provides routines for working with netmap and placement policy.
Package netmap provides routines for working with netmap and placement policy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL