utils

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CLIQueryJSONPrint

func CLIQueryJSONPrint(cdc *codec.Codec, uri string, data []byte, rstTypeFactory func() interface{}) error

func Load

func Load(filepath string, cdc *codec.Codec, factory func() interface{}) (interface{}, error)

Load import and unmarshal by cdc json unmarshal.

func Save added in v0.4.0

func Save(filepath string, cdc *codec.Codec, state interface{}) error

Save save the state to file, using codec json marshal.

Types

type StoreMap added in v0.4.0

type StoreMap map[string]SubStore

func NewStoreMap added in v0.4.0

func NewStoreMap(ss []SubStore) StoreMap

type SubStore added in v0.4.0

type SubStore struct {
	Store      sdk.KVStore
	Prefix     []byte
	ValCreator ValueCreator
	Decoder    Unmarshaler
	NoValue    bool
}

func (SubStore) Iterate added in v0.4.0

func (s SubStore) Iterate(reactor ValueReactor)

type Unmarshaler added in v0.4.0

type Unmarshaler = func(bz []byte, rst interface{})

type ValueCreator added in v0.4.0

type ValueCreator = func() interface{}

type ValueReactor added in v0.4.0

type ValueReactor = func(key []byte, val interface{}) bool

Jump to

Keyboard shortcuts

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