cid

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: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID refs.ContainerID

ID represents v2-compatible container identifier.

func New

func New() *ID

New creates and initializes blank ID.

Defaults:

  • value: nil.

func NewFromV2

func NewFromV2(idV2 *refs.ContainerID) *ID

NewFromV2 wraps v2 ContainerID message to ID.

Nil refs.ContainerID converts to nil.

func (*ID) Equal

func (id *ID) Equal(id2 *ID) bool

Equal returns true if identifiers are identical.

func (*ID) Marshal

func (id *ID) Marshal(b ...[]byte) ([]byte, error)

Marshal marshals ID into a protobuf binary form.

Buffer is allocated when the argument is empty. Otherwise, the first buffer is used.

func (*ID) MarshalJSON

func (id *ID) MarshalJSON() ([]byte, error)

MarshalJSON encodes ID to protobuf JSON format.

func (*ID) Parse

func (id *ID) Parse(s string) error

Parse parses string representation of ID.

Returns error if s is not a base58 encoded ID data.

func (*ID) SetSHA256

func (id *ID) SetSHA256(v [sha256.Size]byte)

SetSHA256 sets container identifier value to SHA256 checksum.

func (*ID) String

func (id *ID) String() string

String returns base58 string representation of ID.

func (*ID) ToV2

func (id *ID) ToV2() *refs.ContainerID

ToV2 returns the v2 container ID message.

Nil ID converts to nil.

func (*ID) Unmarshal

func (id *ID) Unmarshal(data []byte) error

Unmarshal unmarshals protobuf binary representation of ID.

func (*ID) UnmarshalJSON

func (id *ID) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes ID from protobuf JSON format.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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