base58wrapper

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBase58StoreWrapper

func NewBase58StoreWrapper(store storage.Store) storage.Store

NewBase58StoreWrapper creates a new Base58StoreWrapper of store.

Types

type Base58StoreWrapper

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

Base58StoreWrapper is a wrapper store that converts key IDs from base64 to base58 encoded values. Keys IDs will be stored in the embedded store base58 encoded while the user of this wrapper store will interact with the wrapper store using key IDs base64 raw (no padding) URL encoded.

func (*Base58StoreWrapper) Delete

func (b *Base58StoreWrapper) Delete(k string) error

Delete will delete a record with k by converting it from base64 to base58 encoded value first.

func (*Base58StoreWrapper) Get

func (b *Base58StoreWrapper) Get(k string) ([]byte, error)

Get fetches the record based on key by converting the key ID from base58 to base64 encoded value first.

func (*Base58StoreWrapper) Iterator

func (b *Base58StoreWrapper) Iterator(startKey, endKey string) storage.StoreIterator

Iterator returns an iterator for the latest snapshot of the underlying store.

Args:

startKey: Start of the key range, include in the range by converting it from base64 to base58 encoded value first. endKey: End of the key range, not include in the range by converting it from base64 to base58 encoded value first.

Returns:

StoreIterator: a wrapped iterator for result range.

func (*Base58StoreWrapper) Put

func (b *Base58StoreWrapper) Put(k string, v []byte) error

Put stores the key and the record by converting the key from base64 to base58 encoded value first.

Jump to

Keyboard shortcuts

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