pkg

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 7 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualChecksums

func EqualChecksums(cs1, cs2 *Checksum) bool

func IsSupportedVersion

func IsSupportedVersion(v *Version) error

IsSupportedVersion returns error if v is not supported by current SDK.

Types

type Checksum

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

func NewChecksumFromV2(cV2 *refs.Checksum) *Checksum

NewChecksumFromV2 wraps v2 Checksum message to Checksum.

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

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
)

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

func NewSignatureFromV2

func NewSignatureFromV2(sV2 *refs.Signature) *Signature

NewSignatureFromV2 wraps v2 Signature message to Signature.

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

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

func NewVersionFromV2

func NewVersionFromV2(v *refs.Version) *Version

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

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.

func NewXHeaderFromV2

func NewXHeaderFromV2(v *session.XHeader) *XHeader

NewXHeaderFromV2 wraps v2 XHeader message to XHeader.

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.

func (*XHeader) Value

func (x *XHeader) Value() string

Value returns value of X-Header.

Directories

Path Synopsis
acl
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