utils

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

func SimpleQueryCmd added in v0.6.3

func SimpleQueryCmd(use, short, route, store string, nargs int, rstPointer interface{}) func(*codec.Codec) *cobra.Command

Types

type QueryResolver added in v0.6.3

type QueryResolver = func(ctx sdk.Context, cdc *wire.Codec, path []string) ([]byte, sdk.Error)

return query result

func NewQueryResolver added in v0.6.3

func NewQueryResolver(numArgs int, resolver StoreQuerier) QueryResolver

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 StoreQuerier added in v0.6.3

type StoreQuerier = func(args ...string) (interface{}, sdk.Error)

query store

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