types

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	BeginBlock = "BeginBlock"
	EndBlock   = "EndBlock"
)
View Source
const (
	TimerVersionKey = "Timer_Version"
	NextTimerPrefix = "Timer_Next_"
	TimerPrefix     = "Timer_Value_"
)
View Source
const (
	MODULE_NAME string = "timerstore"
)
View Source
const (
	ModuleName = "timerstore"
)
View Source
const (
	NonASCIICharPlaceholder = '$'
)

Variables

View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTimer        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTimer          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTimer = fmt.Errorf("proto: unexpected end of group")
)
View Source
var NextTimerKey = []string{
	"NextBlock",
	"NextDate",
}
View Source
var TimerTypePrefix = []string{
	"Block_",
	"Time_",
}

Functions

func DecodeBlockAndKey

func DecodeBlockAndKey(encodedKey []byte) (uint64, []byte)

func DecodeKey

func DecodeKey(encodedKey []byte) uint64

func EncodeBlockAndKey

func EncodeBlockAndKey(block uint64, key []byte) []byte

func EncodeKey

func EncodeKey(key uint64) []byte

func KeyPrefix

func KeyPrefix(p string) []byte

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func TimerVersion

func TimerVersion() uint64

TimerVersion returns the timer library version

Types

type GenesisState

type GenesisState struct {
	Version         uint64              `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
	NextBlockHeight uint64              `protobuf:"varint,2,opt,name=next_block_height,json=nextBlockHeight,proto3" json:"next_block_height,omitempty"`
	NextBlockTime   uint64              `protobuf:"varint,3,opt,name=next_block_time,json=nextBlockTime,proto3" json:"next_block_time,omitempty"`
	TimeEntries     []GenesisTimerEntry `protobuf:"bytes,4,rep,name=time_entries,json=timeEntries,proto3" json:"time_entries"`
	BlockEntries    []GenesisTimerEntry `protobuf:"bytes,5,rep,name=block_entries,json=blockEntries,proto3" json:"block_entries"`
}

func DefaultGenesis

func DefaultGenesis() *GenesisState

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetBlockEntries

func (m *GenesisState) GetBlockEntries() []GenesisTimerEntry

func (*GenesisState) GetNextBlockHeight

func (m *GenesisState) GetNextBlockHeight() uint64

func (*GenesisState) GetNextBlockTime

func (m *GenesisState) GetNextBlockTime() uint64

func (*GenesisState) GetTimeEntries

func (m *GenesisState) GetTimeEntries() []GenesisTimerEntry

func (*GenesisState) GetVersion

func (m *GenesisState) GetVersion() uint64

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type GenesisTimerEntry

type GenesisTimerEntry struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value uint64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	Data  []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
}

func (*GenesisTimerEntry) Descriptor

func (*GenesisTimerEntry) Descriptor() ([]byte, []int)

func (*GenesisTimerEntry) GetData

func (m *GenesisTimerEntry) GetData() []byte

func (*GenesisTimerEntry) GetKey

func (m *GenesisTimerEntry) GetKey() string

func (*GenesisTimerEntry) GetValue

func (m *GenesisTimerEntry) GetValue() uint64

func (*GenesisTimerEntry) Marshal

func (m *GenesisTimerEntry) Marshal() (dAtA []byte, err error)

func (*GenesisTimerEntry) MarshalTo

func (m *GenesisTimerEntry) MarshalTo(dAtA []byte) (int, error)

func (*GenesisTimerEntry) MarshalToSizedBuffer

func (m *GenesisTimerEntry) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisTimerEntry) ProtoMessage

func (*GenesisTimerEntry) ProtoMessage()

func (*GenesisTimerEntry) Reset

func (m *GenesisTimerEntry) Reset()

func (*GenesisTimerEntry) Size

func (m *GenesisTimerEntry) Size() (n int)

func (*GenesisTimerEntry) String

func (m *GenesisTimerEntry) String() string

func (*GenesisTimerEntry) Unmarshal

func (m *GenesisTimerEntry) Unmarshal(dAtA []byte) error

func (*GenesisTimerEntry) XXX_DiscardUnknown

func (m *GenesisTimerEntry) XXX_DiscardUnknown()

func (*GenesisTimerEntry) XXX_Marshal

func (m *GenesisTimerEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisTimerEntry) XXX_Merge

func (m *GenesisTimerEntry) XXX_Merge(src proto.Message)

func (*GenesisTimerEntry) XXX_Size

func (m *GenesisTimerEntry) XXX_Size() int

func (*GenesisTimerEntry) XXX_Unmarshal

func (m *GenesisTimerEntry) XXX_Unmarshal(b []byte) error

type QueryAllTimersRequest

type QueryAllTimersRequest struct {
	StoreKey string `protobuf:"bytes,1,opt,name=store_key,json=storeKey,proto3" json:"store_key,omitempty"`
	Prefix   string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
}

func (*QueryAllTimersRequest) Descriptor

func (*QueryAllTimersRequest) Descriptor() ([]byte, []int)

func (*QueryAllTimersRequest) GetPrefix

func (m *QueryAllTimersRequest) GetPrefix() string

func (*QueryAllTimersRequest) GetStoreKey

func (m *QueryAllTimersRequest) GetStoreKey() string

func (*QueryAllTimersRequest) Marshal

func (m *QueryAllTimersRequest) Marshal() (dAtA []byte, err error)

func (*QueryAllTimersRequest) MarshalTo

func (m *QueryAllTimersRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryAllTimersRequest) MarshalToSizedBuffer

func (m *QueryAllTimersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAllTimersRequest) ProtoMessage

func (*QueryAllTimersRequest) ProtoMessage()

func (*QueryAllTimersRequest) Reset

func (m *QueryAllTimersRequest) Reset()

func (*QueryAllTimersRequest) Size

func (m *QueryAllTimersRequest) Size() (n int)

func (*QueryAllTimersRequest) String

func (m *QueryAllTimersRequest) String() string

func (*QueryAllTimersRequest) Unmarshal

func (m *QueryAllTimersRequest) Unmarshal(dAtA []byte) error

func (*QueryAllTimersRequest) XXX_DiscardUnknown

func (m *QueryAllTimersRequest) XXX_DiscardUnknown()

func (*QueryAllTimersRequest) XXX_Marshal

func (m *QueryAllTimersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAllTimersRequest) XXX_Merge

func (m *QueryAllTimersRequest) XXX_Merge(src proto.Message)

func (*QueryAllTimersRequest) XXX_Size

func (m *QueryAllTimersRequest) XXX_Size() int

func (*QueryAllTimersRequest) XXX_Unmarshal

func (m *QueryAllTimersRequest) XXX_Unmarshal(b []byte) error

type QueryAllTimersResponse

type QueryAllTimersResponse struct {
	BlockTimeTimers   []*TimerInfo `protobuf:"bytes,1,rep,name=blockTimeTimers,proto3" json:"blockTimeTimers,omitempty"`
	BlockHeightTimers []*TimerInfo `protobuf:"bytes,2,rep,name=blockHeightTimers,proto3" json:"blockHeightTimers,omitempty"`
	Tick              string       `protobuf:"bytes,3,opt,name=tick,proto3" json:"tick,omitempty"`
}

func (*QueryAllTimersResponse) Descriptor

func (*QueryAllTimersResponse) Descriptor() ([]byte, []int)

func (*QueryAllTimersResponse) GetBlockHeightTimers

func (m *QueryAllTimersResponse) GetBlockHeightTimers() []*TimerInfo

func (*QueryAllTimersResponse) GetBlockTimeTimers

func (m *QueryAllTimersResponse) GetBlockTimeTimers() []*TimerInfo

func (*QueryAllTimersResponse) GetTick

func (m *QueryAllTimersResponse) GetTick() string

func (*QueryAllTimersResponse) Marshal

func (m *QueryAllTimersResponse) Marshal() (dAtA []byte, err error)

func (*QueryAllTimersResponse) MarshalTo

func (m *QueryAllTimersResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryAllTimersResponse) MarshalToSizedBuffer

func (m *QueryAllTimersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryAllTimersResponse) ProtoMessage

func (*QueryAllTimersResponse) ProtoMessage()

func (*QueryAllTimersResponse) Reset

func (m *QueryAllTimersResponse) Reset()

func (*QueryAllTimersResponse) Size

func (m *QueryAllTimersResponse) Size() (n int)

func (*QueryAllTimersResponse) String

func (m *QueryAllTimersResponse) String() string

func (*QueryAllTimersResponse) Unmarshal

func (m *QueryAllTimersResponse) Unmarshal(dAtA []byte) error

func (*QueryAllTimersResponse) XXX_DiscardUnknown

func (m *QueryAllTimersResponse) XXX_DiscardUnknown()

func (*QueryAllTimersResponse) XXX_Marshal

func (m *QueryAllTimersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryAllTimersResponse) XXX_Merge

func (m *QueryAllTimersResponse) XXX_Merge(src proto.Message)

func (*QueryAllTimersResponse) XXX_Size

func (m *QueryAllTimersResponse) XXX_Size() int

func (*QueryAllTimersResponse) XXX_Unmarshal

func (m *QueryAllTimersResponse) XXX_Unmarshal(b []byte) error

type QueryClient

type QueryClient interface {
	// Queries a timer store for all its timers.
	AllTimers(ctx context.Context, in *QueryAllTimersRequest, opts ...grpc.CallOption) (*QueryAllTimersResponse, error)
	// Queries for all store keys.
	StoreKeys(ctx context.Context, in *QueryStoreKeysRequest, opts ...grpc.CallOption) (*QueryStoreKeysResponse, error)
	// Queries for next timeout of a timer.
	Next(ctx context.Context, in *QueryNextRequest, opts ...grpc.CallOption) (*QueryNextResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryNextRequest

type QueryNextRequest struct {
	StoreKey string `protobuf:"bytes,1,opt,name=store_key,json=storeKey,proto3" json:"store_key,omitempty"`
	Prefix   string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
}

func (*QueryNextRequest) Descriptor

func (*QueryNextRequest) Descriptor() ([]byte, []int)

func (*QueryNextRequest) GetPrefix

func (m *QueryNextRequest) GetPrefix() string

func (*QueryNextRequest) GetStoreKey

func (m *QueryNextRequest) GetStoreKey() string

func (*QueryNextRequest) Marshal

func (m *QueryNextRequest) Marshal() (dAtA []byte, err error)

func (*QueryNextRequest) MarshalTo

func (m *QueryNextRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryNextRequest) MarshalToSizedBuffer

func (m *QueryNextRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryNextRequest) ProtoMessage

func (*QueryNextRequest) ProtoMessage()

func (*QueryNextRequest) Reset

func (m *QueryNextRequest) Reset()

func (*QueryNextRequest) Size

func (m *QueryNextRequest) Size() (n int)

func (*QueryNextRequest) String

func (m *QueryNextRequest) String() string

func (*QueryNextRequest) Unmarshal

func (m *QueryNextRequest) Unmarshal(dAtA []byte) error

func (*QueryNextRequest) XXX_DiscardUnknown

func (m *QueryNextRequest) XXX_DiscardUnknown()

func (*QueryNextRequest) XXX_Marshal

func (m *QueryNextRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryNextRequest) XXX_Merge

func (m *QueryNextRequest) XXX_Merge(src proto.Message)

func (*QueryNextRequest) XXX_Size

func (m *QueryNextRequest) XXX_Size() int

func (*QueryNextRequest) XXX_Unmarshal

func (m *QueryNextRequest) XXX_Unmarshal(b []byte) error

type QueryNextResponse

type QueryNextResponse struct {
	NextBlockHeight uint64 `protobuf:"varint,1,opt,name=nextBlockHeight,proto3" json:"nextBlockHeight,omitempty"`
	NextBlockTime   string `protobuf:"bytes,2,opt,name=nextBlockTime,proto3" json:"nextBlockTime,omitempty"`
	Tick            string `protobuf:"bytes,3,opt,name=tick,proto3" json:"tick,omitempty"`
}

func (*QueryNextResponse) Descriptor

func (*QueryNextResponse) Descriptor() ([]byte, []int)

func (*QueryNextResponse) GetNextBlockHeight

func (m *QueryNextResponse) GetNextBlockHeight() uint64

func (*QueryNextResponse) GetNextBlockTime

func (m *QueryNextResponse) GetNextBlockTime() string

func (*QueryNextResponse) GetTick

func (m *QueryNextResponse) GetTick() string

func (*QueryNextResponse) Marshal

func (m *QueryNextResponse) Marshal() (dAtA []byte, err error)

func (*QueryNextResponse) MarshalTo

func (m *QueryNextResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryNextResponse) MarshalToSizedBuffer

func (m *QueryNextResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryNextResponse) ProtoMessage

func (*QueryNextResponse) ProtoMessage()

func (*QueryNextResponse) Reset

func (m *QueryNextResponse) Reset()

func (*QueryNextResponse) Size

func (m *QueryNextResponse) Size() (n int)

func (*QueryNextResponse) String

func (m *QueryNextResponse) String() string

func (*QueryNextResponse) Unmarshal

func (m *QueryNextResponse) Unmarshal(dAtA []byte) error

func (*QueryNextResponse) XXX_DiscardUnknown

func (m *QueryNextResponse) XXX_DiscardUnknown()

func (*QueryNextResponse) XXX_Marshal

func (m *QueryNextResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryNextResponse) XXX_Merge

func (m *QueryNextResponse) XXX_Merge(src proto.Message)

func (*QueryNextResponse) XXX_Size

func (m *QueryNextResponse) XXX_Size() int

func (*QueryNextResponse) XXX_Unmarshal

func (m *QueryNextResponse) XXX_Unmarshal(b []byte) error

type QueryServer

type QueryServer interface {
	// Queries a timer store for all its timers.
	AllTimers(context.Context, *QueryAllTimersRequest) (*QueryAllTimersResponse, error)
	// Queries for all store keys.
	StoreKeys(context.Context, *QueryStoreKeysRequest) (*QueryStoreKeysResponse, error)
	// Queries for next timeout of a timer.
	Next(context.Context, *QueryNextRequest) (*QueryNextResponse, error)
}

QueryServer is the server API for Query service.

type QueryStoreKeysRequest

type QueryStoreKeysRequest struct {
}

func (*QueryStoreKeysRequest) Descriptor

func (*QueryStoreKeysRequest) Descriptor() ([]byte, []int)

func (*QueryStoreKeysRequest) Marshal

func (m *QueryStoreKeysRequest) Marshal() (dAtA []byte, err error)

func (*QueryStoreKeysRequest) MarshalTo

func (m *QueryStoreKeysRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryStoreKeysRequest) MarshalToSizedBuffer

func (m *QueryStoreKeysRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryStoreKeysRequest) ProtoMessage

func (*QueryStoreKeysRequest) ProtoMessage()

func (*QueryStoreKeysRequest) Reset

func (m *QueryStoreKeysRequest) Reset()

func (*QueryStoreKeysRequest) Size

func (m *QueryStoreKeysRequest) Size() (n int)

func (*QueryStoreKeysRequest) String

func (m *QueryStoreKeysRequest) String() string

func (*QueryStoreKeysRequest) Unmarshal

func (m *QueryStoreKeysRequest) Unmarshal(dAtA []byte) error

func (*QueryStoreKeysRequest) XXX_DiscardUnknown

func (m *QueryStoreKeysRequest) XXX_DiscardUnknown()

func (*QueryStoreKeysRequest) XXX_Marshal

func (m *QueryStoreKeysRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryStoreKeysRequest) XXX_Merge

func (m *QueryStoreKeysRequest) XXX_Merge(src proto.Message)

func (*QueryStoreKeysRequest) XXX_Size

func (m *QueryStoreKeysRequest) XXX_Size() int

func (*QueryStoreKeysRequest) XXX_Unmarshal

func (m *QueryStoreKeysRequest) XXX_Unmarshal(b []byte) error

type QueryStoreKeysResponse

type QueryStoreKeysResponse struct {
	Keys []StoreKeyAndPrefix `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys"`
}

func (*QueryStoreKeysResponse) Descriptor

func (*QueryStoreKeysResponse) Descriptor() ([]byte, []int)

func (*QueryStoreKeysResponse) GetKeys

func (*QueryStoreKeysResponse) Marshal

func (m *QueryStoreKeysResponse) Marshal() (dAtA []byte, err error)

func (*QueryStoreKeysResponse) MarshalTo

func (m *QueryStoreKeysResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryStoreKeysResponse) MarshalToSizedBuffer

func (m *QueryStoreKeysResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryStoreKeysResponse) ProtoMessage

func (*QueryStoreKeysResponse) ProtoMessage()

func (*QueryStoreKeysResponse) Reset

func (m *QueryStoreKeysResponse) Reset()

func (*QueryStoreKeysResponse) Size

func (m *QueryStoreKeysResponse) Size() (n int)

func (*QueryStoreKeysResponse) String

func (m *QueryStoreKeysResponse) String() string

func (*QueryStoreKeysResponse) Unmarshal

func (m *QueryStoreKeysResponse) Unmarshal(dAtA []byte) error

func (*QueryStoreKeysResponse) XXX_DiscardUnknown

func (m *QueryStoreKeysResponse) XXX_DiscardUnknown()

func (*QueryStoreKeysResponse) XXX_Marshal

func (m *QueryStoreKeysResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryStoreKeysResponse) XXX_Merge

func (m *QueryStoreKeysResponse) XXX_Merge(src proto.Message)

func (*QueryStoreKeysResponse) XXX_Size

func (m *QueryStoreKeysResponse) XXX_Size() int

func (*QueryStoreKeysResponse) XXX_Unmarshal

func (m *QueryStoreKeysResponse) XXX_Unmarshal(b []byte) error

type StoreKeyAndPrefix

type StoreKeyAndPrefix struct {
	StoreKey string `protobuf:"bytes,1,opt,name=store_key,json=storeKey,proto3" json:"store_key,omitempty"`
	Prefix   string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
}

func (*StoreKeyAndPrefix) Descriptor

func (*StoreKeyAndPrefix) Descriptor() ([]byte, []int)

func (*StoreKeyAndPrefix) GetPrefix

func (m *StoreKeyAndPrefix) GetPrefix() string

func (*StoreKeyAndPrefix) GetStoreKey

func (m *StoreKeyAndPrefix) GetStoreKey() string

func (*StoreKeyAndPrefix) Marshal

func (m *StoreKeyAndPrefix) Marshal() (dAtA []byte, err error)

func (*StoreKeyAndPrefix) MarshalTo

func (m *StoreKeyAndPrefix) MarshalTo(dAtA []byte) (int, error)

func (*StoreKeyAndPrefix) MarshalToSizedBuffer

func (m *StoreKeyAndPrefix) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*StoreKeyAndPrefix) ProtoMessage

func (*StoreKeyAndPrefix) ProtoMessage()

func (*StoreKeyAndPrefix) Reset

func (m *StoreKeyAndPrefix) Reset()

func (*StoreKeyAndPrefix) Size

func (m *StoreKeyAndPrefix) Size() (n int)

func (*StoreKeyAndPrefix) String

func (m *StoreKeyAndPrefix) String() string

func (*StoreKeyAndPrefix) Unmarshal

func (m *StoreKeyAndPrefix) Unmarshal(dAtA []byte) error

func (*StoreKeyAndPrefix) XXX_DiscardUnknown

func (m *StoreKeyAndPrefix) XXX_DiscardUnknown()

func (*StoreKeyAndPrefix) XXX_Marshal

func (m *StoreKeyAndPrefix) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*StoreKeyAndPrefix) XXX_Merge

func (m *StoreKeyAndPrefix) XXX_Merge(src proto.Message)

func (*StoreKeyAndPrefix) XXX_Size

func (m *StoreKeyAndPrefix) XXX_Size() int

func (*StoreKeyAndPrefix) XXX_Unmarshal

func (m *StoreKeyAndPrefix) XXX_Unmarshal(b []byte) error

type TimerCallback

type TimerCallback func(ctx sdk.Context, key, data []byte)

TimerCallback defined the callback handler function

type TimerInfo

type TimerInfo struct {
	// Types that are valid to be assigned to Block:
	//	*TimerInfo_BlockTime
	//	*TimerInfo_BlockHeight
	Block isTimerInfo_Block `protobuf_oneof:"block"`
	Key   string            `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
	Data  []byte            `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"`
}

func (*TimerInfo) Descriptor

func (*TimerInfo) Descriptor() ([]byte, []int)

func (*TimerInfo) GetBlock

func (m *TimerInfo) GetBlock() isTimerInfo_Block

func (*TimerInfo) GetBlockHeight

func (m *TimerInfo) GetBlockHeight() uint64

func (*TimerInfo) GetBlockTime

func (m *TimerInfo) GetBlockTime() string

func (*TimerInfo) GetData

func (m *TimerInfo) GetData() []byte

func (*TimerInfo) GetKey

func (m *TimerInfo) GetKey() string

func (*TimerInfo) Marshal

func (m *TimerInfo) Marshal() (dAtA []byte, err error)

func (*TimerInfo) MarshalTo

func (m *TimerInfo) MarshalTo(dAtA []byte) (int, error)

func (*TimerInfo) MarshalToSizedBuffer

func (m *TimerInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TimerInfo) ProtoMessage

func (*TimerInfo) ProtoMessage()

func (*TimerInfo) Reset

func (m *TimerInfo) Reset()

func (*TimerInfo) Size

func (m *TimerInfo) Size() (n int)

func (*TimerInfo) String

func (m *TimerInfo) String() string

func (*TimerInfo) Unmarshal

func (m *TimerInfo) Unmarshal(dAtA []byte) error

func (*TimerInfo) XXX_DiscardUnknown

func (m *TimerInfo) XXX_DiscardUnknown()

func (*TimerInfo) XXX_Marshal

func (m *TimerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*TimerInfo) XXX_Merge

func (m *TimerInfo) XXX_Merge(src proto.Message)

func (*TimerInfo) XXX_OneofWrappers

func (*TimerInfo) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*TimerInfo) XXX_Size

func (m *TimerInfo) XXX_Size() int

func (*TimerInfo) XXX_Unmarshal

func (m *TimerInfo) XXX_Unmarshal(b []byte) error

type TimerInfo_BlockHeight

type TimerInfo_BlockHeight struct {
	BlockHeight uint64 `protobuf:"varint,2,opt,name=blockHeight,proto3,oneof" json:"blockHeight,omitempty"`
}

func (*TimerInfo_BlockHeight) MarshalTo

func (m *TimerInfo_BlockHeight) MarshalTo(dAtA []byte) (int, error)

func (*TimerInfo_BlockHeight) MarshalToSizedBuffer

func (m *TimerInfo_BlockHeight) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TimerInfo_BlockHeight) Size

func (m *TimerInfo_BlockHeight) Size() (n int)

type TimerInfo_BlockTime

type TimerInfo_BlockTime struct {
	BlockTime string `protobuf:"bytes,1,opt,name=blockTime,proto3,oneof" json:"blockTime,omitempty"`
}

func (*TimerInfo_BlockTime) MarshalTo

func (m *TimerInfo_BlockTime) MarshalTo(dAtA []byte) (int, error)

func (*TimerInfo_BlockTime) MarshalToSizedBuffer

func (m *TimerInfo_BlockTime) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*TimerInfo_BlockTime) Size

func (m *TimerInfo_BlockTime) Size() (n int)

type TimerStore

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

TimerStore represents a timer store to manager timers and timeouts

func NewTimerStore

func NewTimerStore(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, prefix string) *TimerStore

NewTimerStore returns a new TimerStore object

func (*TimerStore) AddTimerByBlockHeight

func (tstore *TimerStore) AddTimerByBlockHeight(ctx sdk.Context, block uint64, key, data []byte)

AddTimerByBlockHeight adds a new timer to expire on a given block height. If a timer for that <block, key> tuple exists, it will be overridden.

func (*TimerStore) AddTimerByBlockTime

func (tstore *TimerStore) AddTimerByBlockTime(ctx sdk.Context, timestamp uint64, key, data []byte)

AddTimerByBlockTime adds a new timer to expire on a future block with the given timestamp. If a timer for that <timestamp, key> tuple exists, it will be overridden.

func (*TimerStore) DelTimerByBlockHeight

func (tstore *TimerStore) DelTimerByBlockHeight(ctx sdk.Context, block uint64, key []byte)

DelTimerByBlockHeight removes an existing timer for the <block, key> tuple.

func (*TimerStore) DelTimerByBlockTime

func (tstore *TimerStore) DelTimerByBlockTime(ctx sdk.Context, timestamp uint64, key []byte)

DelTimerByBlockTime removes an existing timer for the <timestamp, key> tuple.

func (*TimerStore) DumpAllTimers

func (tstore *TimerStore) DumpAllTimers(ctx sdk.Context, which TimerType) []*TimerInfo

DumpAllTimers dumps the details of all existing timers (of a type) into a string (for test/debug).

func (*TimerStore) Export

func (tstore *TimerStore) Export(ctx sdk.Context) (gs GenesisState)

func (*TimerStore) GetFrontTimers

func (tstore *TimerStore) GetFrontTimers(ctx sdk.Context, which TimerType) (keys [][]byte, expiries []uint64, data [][]byte)

func (*TimerStore) GetNextTimeoutBlockHeight

func (tstore *TimerStore) GetNextTimeoutBlockHeight(ctx sdk.Context) uint64

func (*TimerStore) GetNextTimeoutBlockTime

func (tstore *TimerStore) GetNextTimeoutBlockTime(ctx sdk.Context) uint64

func (*TimerStore) GetStoreKey

func (tstore *TimerStore) GetStoreKey() storetypes.StoreKey

func (*TimerStore) GetStorePrefix

func (fs *TimerStore) GetStorePrefix() string

func (*TimerStore) HasTimerByBlockHeight

func (tstore *TimerStore) HasTimerByBlockHeight(ctx sdk.Context, block uint64, key []byte) bool

HasTimerByBlockHeight checks whether a timer exists for the <block, key> tuple.

func (*TimerStore) HasTimerByBlockTime

func (tstore *TimerStore) HasTimerByBlockTime(ctx sdk.Context, timestamp uint64, key []byte) bool

HasTimerByBlockTime checks whether a timer exists for the <timestamp, key> tuple.

func (*TimerStore) Init

func (tstore *TimerStore) Init(ctx sdk.Context, gs GenesisState)

func (*TimerStore) MigrateVersion

func (tstore *TimerStore) MigrateVersion(ctx sdk.Context) (err error)

func (*TimerStore) Tick

func (tstore *TimerStore) Tick(ctx sdk.Context)

Tick advances the timer by a block. It should be called at the beginning of each block.

func (*TimerStore) WithCallbackByBlockHeight

func (tstore *TimerStore) WithCallbackByBlockHeight(callback TimerCallback) *TimerStore

WithCallbackByBlockHeight sets a callback handler for timeouts (by block height)

func (*TimerStore) WithCallbackByBlockTime

func (tstore *TimerStore) WithCallbackByBlockTime(callback TimerCallback) *TimerStore

WithCallbackByBlockHeight sets a callback handler for timeouts (by block timestamp)

type TimerType

type TimerType int
const (
	BlockHeight TimerType = iota
	BlockTime
)

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) AllTimers

func (*UnimplementedQueryServer) Next

func (*UnimplementedQueryServer) StoreKeys

Jump to

Keyboard shortcuts

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