oid

package
v1.0.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: Apache-2.0 Imports: 6 Imported by: 65

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID refs.ObjectID

ID represents v2-compatible object identifier.

func NewID

func NewID() *ID

NewID creates and initializes blank ID.

Works similar as NewIDFromV2(new(ObjectID)).

Defaults:

  • value: nil.

func NewIDFromV2

func NewIDFromV2(idV2 *refs.ObjectID) *ID

NewIDFromV2 wraps v2 ObjectID message to ID.

Nil refs.ObjectID 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() ([]byte, error)

Marshal marshals ID into a protobuf binary form.

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 converts base58 string representation into ID.

func (*ID) SetSHA256

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

SetSHA256 sets object 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.ObjectID

ToV2 converts ID to v2 ObjectID 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