key

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 17, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var B58KeyConverter = b58KeyConverter{}

B58KeyConverter -- for KeyTransform datastores (static as only one obj needed)

Functions

func B58KeyEncode

func B58KeyEncode(k Key) string

B58KeyEncode returns Key in a b58 encoded string

Types

type Key

type Key string

Key is a string representation of multihash for use with maps.

func B58KeyDecode

func B58KeyDecode(s string) Key

B58KeyDecode returns Key from a b58 encoded string

func KeyFromDsKey

func KeyFromDsKey(dsk ds.Key) Key

KeyFromDsKey returns a Datastore key

func (Key) B58String

func (k Key) B58String() string

B58String returns Key in a b58 encoded string

func (Key) DsKey

func (k Key) DsKey() ds.Key

DsKey returns a Datastore key

func (*Key) Loggable

func (k *Key) Loggable() map[string]interface{}

func (*Key) MarshalJSON

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

MarshalJSON returns a JSON-encoded Key (string)

func (Key) String

func (k Key) String() string

String is utililty function for printing out keys as strings (Pretty).

func (Key) ToMultihash

func (k Key) ToMultihash() mh.Multihash

func (*Key) UnmarshalJSON

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

UnmarshalJSON returns a JSON-encoded Key (string)

type KeySet

type KeySet interface {
	Add(Key)
	Has(Key) bool
	Remove(Key)
	Keys() []Key
}

func NewKeySet

func NewKeySet() KeySet

type KeySlice

type KeySlice []Key

KeySlice is used for sorting Keys

func (KeySlice) Len

func (es KeySlice) Len() int

func (KeySlice) Less

func (es KeySlice) Less(i, j int) bool

func (KeySlice) Swap

func (es KeySlice) Swap(i, j int)

Jump to

Keyboard shortcuts

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