shard

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0, MIT Imports: 3 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	// contains filtered or unexported fields
}

Key represents a shard key. It can be instantiated from a string, a byte slice, or a CID.

func KeyFromBytes

func KeyFromBytes(b []byte) Key

KeyFromBytes returns a key from a byte slice, encoding it in b58 first.

func KeyFromCID

func KeyFromCID(cid cid.Cid) Key

KeyFromCID returns a key representing a CID.

func KeyFromString

func KeyFromString(str string) Key

KeyFromString returns a key representing an arbitrary string.

func (Key) MarshalJSON added in v0.4.5

func (k Key) MarshalJSON() ([]byte, error)

We need a custom JSON marshaller and unmarshaller because str is a private field

func (Key) String

func (k Key) String() string

String returns the string representation for this key.

func (*Key) UnmarshalJSON added in v0.4.5

func (k *Key) UnmarshalJSON(bz []byte) error

Jump to

Keyboard shortcuts

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