kvstore

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const KvMapperName = "kv"

Variables

This section is empty.

Functions

func GetKVCmd

func GetKVCmd(cdc *wire.Codec) *cobra.Command

SendTxCmd will create a send tx and sign it with the given key.

func NewGetKVReq

func NewGetKVReq(r *http.Request) (*getKVReq, error)

func NewSendKVReq

func NewSendKVReq(r *http.Request) (*sendKVReq, error)

func QueryKRequestHandlerFnGet

func QueryKRequestHandlerFnGet(
	storeName string, cdc *wire.Codec,
	cliCtx context.CLIContext,
) http.HandlerFunc

query accountREST Handler

func RegisterRoutes

func RegisterRoutes(cdc *wire.Codec, r *mux.Router)

register REST routes

func SendKVCmd

func SendKVCmd(cdc *wire.Codec) *cobra.Command

SendTxCmd will create a send tx and sign it with the given key.

Types

type GetKVOption

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

GetKVOption option param ofr get kv

func NewGetKVOption

func NewGetKVOption(fs ...SetGetKVOption) (*GetKVOption, error)

NewGetKVOption new and set option param

type KVStub

type KVStub struct {
	KvTx KvstoreTx
}

func NewKVStub

func NewKVStub() KVStub

func (KVStub) CustomerQuery

func (kv KVStub) CustomerQuery(ctx ctx.Context, route []string, req abci.RequestQuery) (res []byte, err types.Error)

func (KVStub) EndBlockNotify

func (kv KVStub) EndBlockNotify(ctx context.Context)

func (KVStub) Name

func (kv KVStub) Name() string

func (KVStub) RegisterCdc

func (kv KVStub) RegisterCdc(cdc *go_amino.Codec)

func (KVStub) ResultNotify

func (kv KVStub) ResultNotify(ctx context.Context, txQcpResult interface{}) *types.Result

func (KVStub) StartX

func (kv KVStub) StartX(base *baseapp.QstarsBaseApp) error

type KvstoreTx

type KvstoreTx struct {
	Key   []byte
	Value []byte
	Bytes []byte
}

func NewKvstoreTx

func NewKvstoreTx(key []byte, value []byte) KvstoreTx

func NewKvstoreTxHandler

func NewKvstoreTxHandler() KvstoreTx

func (KvstoreTx) CalcGas

func (kv KvstoreTx) CalcGas() types.BigInt

func (KvstoreTx) Exec

func (kv KvstoreTx) Exec(ctx context.Context) (result types.Result, crossTxQcps *txs.TxQcp)

func (KvstoreTx) GetGasPayer

func (kv KvstoreTx) GetGasPayer() types.Address

func (KvstoreTx) GetSignData

func (kv KvstoreTx) GetSignData() []byte

func (KvstoreTx) GetSigner

func (kv KvstoreTx) GetSigner() []types.Address

func (KvstoreTx) ValidateData

func (kv KvstoreTx) ValidateData(ctx context.Context) error

type ResultGetKV

type ResultGetKV struct {
	Value string `json:"value"`
}

ResultGetKV result of get kv

func GetKV

func GetKV(cdc *wire.Codec, key string, opt *GetKVOption) (*ResultGetKV, error)

GetKV process of get kv

type ResultSendKV

type ResultSendKV struct {
	Hash string `json:"hash"`
}

ResultSendKV result of send kv

func SendKV

func SendKV(cdc *wire.Codec, privateKey, key, value string, option *SendKVOption) (*ResultSendKV, error)

SendKV process of set kv

type SendKVOption

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

SendKVOption option param ofr send kv

func NewSendKVOption

func NewSendKVOption(fs ...SetSendKVOption) (*SendKVOption, error)

NewSendKVOption new and set option param

type SetGetKVOption

type SetGetKVOption func(*GetKVOption) error

func GetKVOptionChainID

func GetKVOptionChainID(chainID string) SetGetKVOption

GetKVOptionChainID set chain id

type SetSendKVOption

type SetSendKVOption func(*SendKVOption) error

func SendKVOptionChainID

func SendKVOptionChainID(chainID string) SetSendKVOption

SendKVOptionChainID set chain id

func SendKVOptionSequence

func SendKVOptionSequence(sequence string) SetSendKVOption

SendKVOptionSequence

Jump to

Keyboard shortcuts

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