Documentation ¶
Overview ¶
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func GrpcQueryServiceDesc() grpc.ServiceDesc
- func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error
- func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- func ValidateEpochIdentifierInterface(i interface{}) error
- func ValidateEpochIdentifierString(s string) error
- type EpochHooks
- type EpochInfo
- func (*EpochInfo) Descriptor() ([]byte, []int)
- func (m *EpochInfo) GetCurrentEpoch() uint64
- func (m *EpochInfo) GetCurrentEpochStartHeight() int64
- func (m *EpochInfo) GetCurrentEpochStartTime() time.Time
- func (m *EpochInfo) GetDuration() time.Duration
- func (m *EpochInfo) GetEpochCountingStarted() bool
- func (m *EpochInfo) GetIdentifier() string
- func (m *EpochInfo) GetStartTime() time.Time
- func (m *EpochInfo) Marshal() (dAtA []byte, err error)
- func (m *EpochInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *EpochInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EpochInfo) ProtoMessage()
- func (m *EpochInfo) Reset()
- func (m *EpochInfo) Size() (n int)
- func (m *EpochInfo) String() string
- func (m *EpochInfo) Unmarshal(dAtA []byte) error
- func (e *EpochInfo) Validate() error
- func (m *EpochInfo) XXX_DiscardUnknown()
- func (m *EpochInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EpochInfo) XXX_Merge(src proto.Message)
- func (m *EpochInfo) XXX_Size() int
- func (m *EpochInfo) XXX_Unmarshal(b []byte) error
- type EventEpochEnd
- func (*EventEpochEnd) Descriptor() ([]byte, []int)
- func (m *EventEpochEnd) GetEpochNumber() uint64
- func (m *EventEpochEnd) Marshal() (dAtA []byte, err error)
- func (m *EventEpochEnd) MarshalTo(dAtA []byte) (int, error)
- func (m *EventEpochEnd) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EventEpochEnd) ProtoMessage()
- func (m *EventEpochEnd) Reset()
- func (m *EventEpochEnd) Size() (n int)
- func (m *EventEpochEnd) String() string
- func (m *EventEpochEnd) Unmarshal(dAtA []byte) error
- func (m *EventEpochEnd) XXX_DiscardUnknown()
- func (m *EventEpochEnd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EventEpochEnd) XXX_Merge(src proto.Message)
- func (m *EventEpochEnd) XXX_Size() int
- func (m *EventEpochEnd) XXX_Unmarshal(b []byte) error
- type EventEpochStart
- func (*EventEpochStart) Descriptor() ([]byte, []int)
- func (m *EventEpochStart) GetEpochNumber() uint64
- func (m *EventEpochStart) GetEpochStartTime() time.Time
- func (m *EventEpochStart) Marshal() (dAtA []byte, err error)
- func (m *EventEpochStart) MarshalTo(dAtA []byte) (int, error)
- func (m *EventEpochStart) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EventEpochStart) ProtoMessage()
- func (m *EventEpochStart) Reset()
- func (m *EventEpochStart) Size() (n int)
- func (m *EventEpochStart) String() string
- func (m *EventEpochStart) Unmarshal(dAtA []byte) error
- func (m *EventEpochStart) XXX_DiscardUnknown()
- func (m *EventEpochStart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EventEpochStart) XXX_Merge(src proto.Message)
- func (m *EventEpochStart) XXX_Size() int
- func (m *EventEpochStart) XXX_Unmarshal(b []byte) error
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) GetEpochs() []EpochInfo
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (gs GenesisState) Validate() error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type MultiEpochHooks
- type QueryClient
- type QueryCurrentEpochRequest
- func (*QueryCurrentEpochRequest) Descriptor() ([]byte, []int)
- func (m *QueryCurrentEpochRequest) GetIdentifier() string
- func (m *QueryCurrentEpochRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryCurrentEpochRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryCurrentEpochRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryCurrentEpochRequest) ProtoMessage()
- func (m *QueryCurrentEpochRequest) Reset()
- func (m *QueryCurrentEpochRequest) Size() (n int)
- func (m *QueryCurrentEpochRequest) String() string
- func (m *QueryCurrentEpochRequest) Unmarshal(dAtA []byte) error
- func (m *QueryCurrentEpochRequest) XXX_DiscardUnknown()
- func (m *QueryCurrentEpochRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryCurrentEpochRequest) XXX_Merge(src proto.Message)
- func (m *QueryCurrentEpochRequest) XXX_Size() int
- func (m *QueryCurrentEpochRequest) XXX_Unmarshal(b []byte) error
- type QueryCurrentEpochResponse
- func (*QueryCurrentEpochResponse) Descriptor() ([]byte, []int)
- func (m *QueryCurrentEpochResponse) GetCurrentEpoch() uint64
- func (m *QueryCurrentEpochResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryCurrentEpochResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryCurrentEpochResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryCurrentEpochResponse) ProtoMessage()
- func (m *QueryCurrentEpochResponse) Reset()
- func (m *QueryCurrentEpochResponse) Size() (n int)
- func (m *QueryCurrentEpochResponse) String() string
- func (m *QueryCurrentEpochResponse) Unmarshal(dAtA []byte) error
- func (m *QueryCurrentEpochResponse) XXX_DiscardUnknown()
- func (m *QueryCurrentEpochResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryCurrentEpochResponse) XXX_Merge(src proto.Message)
- func (m *QueryCurrentEpochResponse) XXX_Size() int
- func (m *QueryCurrentEpochResponse) XXX_Unmarshal(b []byte) error
- type QueryEpochInfosRequest
- func (*QueryEpochInfosRequest) Descriptor() ([]byte, []int)
- func (m *QueryEpochInfosRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryEpochInfosRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryEpochInfosRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryEpochInfosRequest) ProtoMessage()
- func (m *QueryEpochInfosRequest) Reset()
- func (m *QueryEpochInfosRequest) Size() (n int)
- func (m *QueryEpochInfosRequest) String() string
- func (m *QueryEpochInfosRequest) Unmarshal(dAtA []byte) error
- func (m *QueryEpochInfosRequest) XXX_DiscardUnknown()
- func (m *QueryEpochInfosRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryEpochInfosRequest) XXX_Merge(src proto.Message)
- func (m *QueryEpochInfosRequest) XXX_Size() int
- func (m *QueryEpochInfosRequest) XXX_Unmarshal(b []byte) error
- type QueryEpochInfosResponse
- func (*QueryEpochInfosResponse) Descriptor() ([]byte, []int)
- func (m *QueryEpochInfosResponse) GetEpochs() []EpochInfo
- func (m *QueryEpochInfosResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryEpochInfosResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryEpochInfosResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryEpochInfosResponse) ProtoMessage()
- func (m *QueryEpochInfosResponse) Reset()
- func (m *QueryEpochInfosResponse) Size() (n int)
- func (m *QueryEpochInfosResponse) String() string
- func (m *QueryEpochInfosResponse) Unmarshal(dAtA []byte) error
- func (m *QueryEpochInfosResponse) XXX_DiscardUnknown()
- func (m *QueryEpochInfosResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryEpochInfosResponse) XXX_Merge(src proto.Message)
- func (m *QueryEpochInfosResponse) XXX_Size() int
- func (m *QueryEpochInfosResponse) XXX_Unmarshal(b []byte) error
- type QueryServer
- type UnimplementedQueryServer
Constants ¶
const ( // WeekEpochID defines the identifier for weekly epochs WeekEpochID = "week" // DayEpochID defines the identifier for daily epochs DayEpochID = "day" // HourEpochID defines the identifier for hourly epochs HourEpochID = "hour" // FifteenMinuteEpochID defines the identifier for 15 minute epochs FifteenMinuteEpochID = "15 min" // ThirtyMinuteEpochID defines the identifier for 30 minute epochs ThirtyMinuteEpochID = "30 min" )
const ( // ModuleName defines the module name. ModuleName = "epochs" // StoreKey defines the primary module store key. StoreKey = ModuleName // RouterKey is the message route for slashing. RouterKey = ModuleName // QuerierRoute defines the module's query routing key. QuerierRoute = ModuleName )
Variables ¶
var ( ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupEvent = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthState = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowState = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupState = fmt.Errorf("proto: unexpected end of group") )
var (
ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error")
)
x/epochs module sentinel errors.
var KeyPrefixEpoch = []byte{0x01}
KeyPrefixEpoch defines prefix key for storing epochs.
Functions ¶
func GrpcQueryServiceDesc ¶
func GrpcQueryServiceDesc() grpc.ServiceDesc
GrpcQueryServiceDesc represents the query server's RPC service specification. This gives access to the service name and method names needed for stargate queries.
func RegisterQueryHandler ¶
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 ValidateEpochIdentifierInterface ¶
func ValidateEpochIdentifierInterface(i interface{}) error
ValidateEpochIdentifierInterface performs a stateless validation of the epoch ID interface.
func ValidateEpochIdentifierString ¶
ValidateEpochIdentifierString performs a stateless validation of the epoch ID.
Types ¶
type EpochHooks ¶
type EpochHooks interface { // AfterEpochEnd the first block whose timestamp is after the duration is // counted as the end of the epoch AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber uint64) // BeforeEpochStart new epoch is next block of epoch end block BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber uint64) }
EpochHooks defines a set of lifecycle hooks to occur in the ABCI BeginBlock hooks based on temporal epochs.
type EpochInfo ¶
type EpochInfo struct { // A string identifier for the epoch. e.g. "15min" or "1hour" Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"` // When the epoch repetitino should start. StartTime time.Time `protobuf:"bytes,2,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` // How long each epoch lasts for. Duration time.Duration `protobuf:"bytes,3,opt,name=duration,proto3,stdduration" json:"duration,omitempty" yaml:"duration"` // The current epoch number, starting from 1. CurrentEpoch uint64 `protobuf:"varint,4,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"` // The start timestamp of the current epoch. CurrentEpochStartTime time.Time `` /* 158-byte string literal not displayed */ // Whether or not this epoch has started. Set to true if current blocktime >= // start_time. EpochCountingStarted bool `protobuf:"varint,6,opt,name=epoch_counting_started,json=epochCountingStarted,proto3" json:"epoch_counting_started,omitempty"` // The block height at which the current epoch started at. CurrentEpochStartHeight int64 `` /* 135-byte string literal not displayed */ }
func (*EpochInfo) Descriptor ¶
func (*EpochInfo) GetCurrentEpoch ¶
func (*EpochInfo) GetCurrentEpochStartHeight ¶
func (*EpochInfo) GetCurrentEpochStartTime ¶
func (*EpochInfo) GetDuration ¶
func (*EpochInfo) GetEpochCountingStarted ¶
func (*EpochInfo) GetIdentifier ¶
func (*EpochInfo) GetStartTime ¶
func (*EpochInfo) MarshalToSizedBuffer ¶
func (*EpochInfo) ProtoMessage ¶
func (*EpochInfo) ProtoMessage()
func (*EpochInfo) XXX_DiscardUnknown ¶
func (m *EpochInfo) XXX_DiscardUnknown()
func (*EpochInfo) XXX_Marshal ¶
func (*EpochInfo) XXX_Unmarshal ¶
type EventEpochEnd ¶
type EventEpochEnd struct { // Epoch number, starting from 1. EpochNumber uint64 `protobuf:"varint,1,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` }
func (*EventEpochEnd) Descriptor ¶
func (*EventEpochEnd) Descriptor() ([]byte, []int)
func (*EventEpochEnd) GetEpochNumber ¶
func (m *EventEpochEnd) GetEpochNumber() uint64
func (*EventEpochEnd) Marshal ¶
func (m *EventEpochEnd) Marshal() (dAtA []byte, err error)
func (*EventEpochEnd) MarshalToSizedBuffer ¶
func (m *EventEpochEnd) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EventEpochEnd) ProtoMessage ¶
func (*EventEpochEnd) ProtoMessage()
func (*EventEpochEnd) Reset ¶
func (m *EventEpochEnd) Reset()
func (*EventEpochEnd) Size ¶
func (m *EventEpochEnd) Size() (n int)
func (*EventEpochEnd) String ¶
func (m *EventEpochEnd) String() string
func (*EventEpochEnd) Unmarshal ¶
func (m *EventEpochEnd) Unmarshal(dAtA []byte) error
func (*EventEpochEnd) XXX_DiscardUnknown ¶
func (m *EventEpochEnd) XXX_DiscardUnknown()
func (*EventEpochEnd) XXX_Marshal ¶
func (m *EventEpochEnd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EventEpochEnd) XXX_Merge ¶
func (m *EventEpochEnd) XXX_Merge(src proto.Message)
func (*EventEpochEnd) XXX_Size ¶
func (m *EventEpochEnd) XXX_Size() int
func (*EventEpochEnd) XXX_Unmarshal ¶
func (m *EventEpochEnd) XXX_Unmarshal(b []byte) error
type EventEpochStart ¶
type EventEpochStart struct { // Epoch number, starting from 1. EpochNumber uint64 `protobuf:"varint,1,opt,name=epoch_number,json=epochNumber,proto3" json:"epoch_number,omitempty"` // The start timestamp of the epoch. EpochStartTime time.Time `protobuf:"bytes,2,opt,name=epoch_start_time,json=epochStartTime,proto3,stdtime" json:"epoch_start_time"` }
func (*EventEpochStart) Descriptor ¶
func (*EventEpochStart) Descriptor() ([]byte, []int)
func (*EventEpochStart) GetEpochNumber ¶
func (m *EventEpochStart) GetEpochNumber() uint64
func (*EventEpochStart) GetEpochStartTime ¶
func (m *EventEpochStart) GetEpochStartTime() time.Time
func (*EventEpochStart) Marshal ¶
func (m *EventEpochStart) Marshal() (dAtA []byte, err error)
func (*EventEpochStart) MarshalToSizedBuffer ¶
func (m *EventEpochStart) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EventEpochStart) ProtoMessage ¶
func (*EventEpochStart) ProtoMessage()
func (*EventEpochStart) Reset ¶
func (m *EventEpochStart) Reset()
func (*EventEpochStart) Size ¶
func (m *EventEpochStart) Size() (n int)
func (*EventEpochStart) String ¶
func (m *EventEpochStart) String() string
func (*EventEpochStart) Unmarshal ¶
func (m *EventEpochStart) Unmarshal(dAtA []byte) error
func (*EventEpochStart) XXX_DiscardUnknown ¶
func (m *EventEpochStart) XXX_DiscardUnknown()
func (*EventEpochStart) XXX_Marshal ¶
func (m *EventEpochStart) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EventEpochStart) XXX_Merge ¶
func (m *EventEpochStart) XXX_Merge(src proto.Message)
func (*EventEpochStart) XXX_Size ¶
func (m *EventEpochStart) XXX_Size() int
func (*EventEpochStart) XXX_Unmarshal ¶
func (m *EventEpochStart) XXX_Unmarshal(b []byte) error
type GenesisState ¶
type GenesisState struct {
Epochs []EpochInfo `protobuf:"bytes,1,rep,name=epochs,proto3" json:"epochs"`
}
GenesisState defines the epochs module's genesis state.
func DefaultGenesis ¶
func DefaultGenesis() *GenesisState
DefaultGenesis returns the default Capability genesis state.
func DefaultGenesisFromTime ¶
func DefaultGenesisFromTime(startTime time.Time) *GenesisState
func NewGenesisState ¶
func NewGenesisState(epochs []EpochInfo) *GenesisState
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) GetEpochs ¶
func (m *GenesisState) GetEpochs() []EpochInfo
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err 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) Validate ¶
func (gs GenesisState) Validate() error
Validate performs basic genesis state validation returning an error upon any failure.
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 MultiEpochHooks ¶
type MultiEpochHooks []EpochHooks
MultiEpochHooks combines multiple EpochHooks. All hook functions are executed sequentially in the order of the slice.
func NewMultiEpochHooks ¶
func NewMultiEpochHooks(hooks ...EpochHooks) MultiEpochHooks
func (MultiEpochHooks) AfterEpochEnd ¶
func (h MultiEpochHooks) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber uint64)
AfterEpochEnd runs logic at the end of an epoch.
- epochIdentifier: The unique identifier of specific epoch. Ex: "30 min", "1 min".
- epochNumber: Counter for the specific epoch type identified.
func (MultiEpochHooks) BeforeEpochStart ¶
func (h MultiEpochHooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber uint64)
BeforeEpochStart runs logic in the ABCI BeginBlocker right before an epoch starts.
- epochIdentifier: The unique identifier of specific epoch. Ex: "30 min", "1 min".
- epochNumber: Counter for the specific epoch type identified.
type QueryClient ¶
type QueryClient interface { // EpochInfos provide running epochInfos EpochInfos(ctx context.Context, in *QueryEpochInfosRequest, opts ...grpc.CallOption) (*QueryEpochInfosResponse, error) // CurrentEpoch provide current epoch of specified identifier CurrentEpoch(ctx context.Context, in *QueryCurrentEpochRequest, opts ...grpc.CallOption) (*QueryCurrentEpochResponse, 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 QueryCurrentEpochRequest ¶
type QueryCurrentEpochRequest struct {
Identifier string `protobuf:"bytes,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
}
func (*QueryCurrentEpochRequest) Descriptor ¶
func (*QueryCurrentEpochRequest) Descriptor() ([]byte, []int)
func (*QueryCurrentEpochRequest) GetIdentifier ¶
func (m *QueryCurrentEpochRequest) GetIdentifier() string
func (*QueryCurrentEpochRequest) Marshal ¶
func (m *QueryCurrentEpochRequest) Marshal() (dAtA []byte, err error)
func (*QueryCurrentEpochRequest) MarshalTo ¶
func (m *QueryCurrentEpochRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryCurrentEpochRequest) MarshalToSizedBuffer ¶
func (m *QueryCurrentEpochRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryCurrentEpochRequest) ProtoMessage ¶
func (*QueryCurrentEpochRequest) ProtoMessage()
func (*QueryCurrentEpochRequest) Reset ¶
func (m *QueryCurrentEpochRequest) Reset()
func (*QueryCurrentEpochRequest) Size ¶
func (m *QueryCurrentEpochRequest) Size() (n int)
func (*QueryCurrentEpochRequest) String ¶
func (m *QueryCurrentEpochRequest) String() string
func (*QueryCurrentEpochRequest) Unmarshal ¶
func (m *QueryCurrentEpochRequest) Unmarshal(dAtA []byte) error
func (*QueryCurrentEpochRequest) XXX_DiscardUnknown ¶
func (m *QueryCurrentEpochRequest) XXX_DiscardUnknown()
func (*QueryCurrentEpochRequest) XXX_Marshal ¶
func (m *QueryCurrentEpochRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryCurrentEpochRequest) XXX_Merge ¶
func (m *QueryCurrentEpochRequest) XXX_Merge(src proto.Message)
func (*QueryCurrentEpochRequest) XXX_Size ¶
func (m *QueryCurrentEpochRequest) XXX_Size() int
func (*QueryCurrentEpochRequest) XXX_Unmarshal ¶
func (m *QueryCurrentEpochRequest) XXX_Unmarshal(b []byte) error
type QueryCurrentEpochResponse ¶
type QueryCurrentEpochResponse struct {
CurrentEpoch uint64 `protobuf:"varint,1,opt,name=current_epoch,json=currentEpoch,proto3" json:"current_epoch,omitempty"`
}
func (*QueryCurrentEpochResponse) Descriptor ¶
func (*QueryCurrentEpochResponse) Descriptor() ([]byte, []int)
func (*QueryCurrentEpochResponse) GetCurrentEpoch ¶
func (m *QueryCurrentEpochResponse) GetCurrentEpoch() uint64
func (*QueryCurrentEpochResponse) Marshal ¶
func (m *QueryCurrentEpochResponse) Marshal() (dAtA []byte, err error)
func (*QueryCurrentEpochResponse) MarshalTo ¶
func (m *QueryCurrentEpochResponse) MarshalTo(dAtA []byte) (int, error)
func (*QueryCurrentEpochResponse) MarshalToSizedBuffer ¶
func (m *QueryCurrentEpochResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryCurrentEpochResponse) ProtoMessage ¶
func (*QueryCurrentEpochResponse) ProtoMessage()
func (*QueryCurrentEpochResponse) Reset ¶
func (m *QueryCurrentEpochResponse) Reset()
func (*QueryCurrentEpochResponse) Size ¶
func (m *QueryCurrentEpochResponse) Size() (n int)
func (*QueryCurrentEpochResponse) String ¶
func (m *QueryCurrentEpochResponse) String() string
func (*QueryCurrentEpochResponse) Unmarshal ¶
func (m *QueryCurrentEpochResponse) Unmarshal(dAtA []byte) error
func (*QueryCurrentEpochResponse) XXX_DiscardUnknown ¶
func (m *QueryCurrentEpochResponse) XXX_DiscardUnknown()
func (*QueryCurrentEpochResponse) XXX_Marshal ¶
func (m *QueryCurrentEpochResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryCurrentEpochResponse) XXX_Merge ¶
func (m *QueryCurrentEpochResponse) XXX_Merge(src proto.Message)
func (*QueryCurrentEpochResponse) XXX_Size ¶
func (m *QueryCurrentEpochResponse) XXX_Size() int
func (*QueryCurrentEpochResponse) XXX_Unmarshal ¶
func (m *QueryCurrentEpochResponse) XXX_Unmarshal(b []byte) error
type QueryEpochInfosRequest ¶
type QueryEpochInfosRequest struct { }
func (*QueryEpochInfosRequest) Descriptor ¶
func (*QueryEpochInfosRequest) Descriptor() ([]byte, []int)
func (*QueryEpochInfosRequest) Marshal ¶
func (m *QueryEpochInfosRequest) Marshal() (dAtA []byte, err error)
func (*QueryEpochInfosRequest) MarshalTo ¶
func (m *QueryEpochInfosRequest) MarshalTo(dAtA []byte) (int, error)
func (*QueryEpochInfosRequest) MarshalToSizedBuffer ¶
func (m *QueryEpochInfosRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryEpochInfosRequest) ProtoMessage ¶
func (*QueryEpochInfosRequest) ProtoMessage()
func (*QueryEpochInfosRequest) Reset ¶
func (m *QueryEpochInfosRequest) Reset()
func (*QueryEpochInfosRequest) Size ¶
func (m *QueryEpochInfosRequest) Size() (n int)
func (*QueryEpochInfosRequest) String ¶
func (m *QueryEpochInfosRequest) String() string
func (*QueryEpochInfosRequest) Unmarshal ¶
func (m *QueryEpochInfosRequest) Unmarshal(dAtA []byte) error
func (*QueryEpochInfosRequest) XXX_DiscardUnknown ¶
func (m *QueryEpochInfosRequest) XXX_DiscardUnknown()
func (*QueryEpochInfosRequest) XXX_Marshal ¶
func (m *QueryEpochInfosRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryEpochInfosRequest) XXX_Merge ¶
func (m *QueryEpochInfosRequest) XXX_Merge(src proto.Message)
func (*QueryEpochInfosRequest) XXX_Size ¶
func (m *QueryEpochInfosRequest) XXX_Size() int
func (*QueryEpochInfosRequest) XXX_Unmarshal ¶
func (m *QueryEpochInfosRequest) XXX_Unmarshal(b []byte) error
type QueryEpochInfosResponse ¶
type QueryEpochInfosResponse struct {
Epochs []EpochInfo `protobuf:"bytes,1,rep,name=epochs,proto3" json:"epochs"`
}
func (*QueryEpochInfosResponse) Descriptor ¶
func (*QueryEpochInfosResponse) Descriptor() ([]byte, []int)
func (*QueryEpochInfosResponse) GetEpochs ¶
func (m *QueryEpochInfosResponse) GetEpochs() []EpochInfo
func (*QueryEpochInfosResponse) Marshal ¶
func (m *QueryEpochInfosResponse) Marshal() (dAtA []byte, err error)
func (*QueryEpochInfosResponse) MarshalTo ¶
func (m *QueryEpochInfosResponse) MarshalTo(dAtA []byte) (int, error)
func (*QueryEpochInfosResponse) MarshalToSizedBuffer ¶
func (m *QueryEpochInfosResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryEpochInfosResponse) ProtoMessage ¶
func (*QueryEpochInfosResponse) ProtoMessage()
func (*QueryEpochInfosResponse) Reset ¶
func (m *QueryEpochInfosResponse) Reset()
func (*QueryEpochInfosResponse) Size ¶
func (m *QueryEpochInfosResponse) Size() (n int)
func (*QueryEpochInfosResponse) String ¶
func (m *QueryEpochInfosResponse) String() string
func (*QueryEpochInfosResponse) Unmarshal ¶
func (m *QueryEpochInfosResponse) Unmarshal(dAtA []byte) error
func (*QueryEpochInfosResponse) XXX_DiscardUnknown ¶
func (m *QueryEpochInfosResponse) XXX_DiscardUnknown()
func (*QueryEpochInfosResponse) XXX_Marshal ¶
func (m *QueryEpochInfosResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryEpochInfosResponse) XXX_Merge ¶
func (m *QueryEpochInfosResponse) XXX_Merge(src proto.Message)
func (*QueryEpochInfosResponse) XXX_Size ¶
func (m *QueryEpochInfosResponse) XXX_Size() int
func (*QueryEpochInfosResponse) XXX_Unmarshal ¶
func (m *QueryEpochInfosResponse) XXX_Unmarshal(b []byte) error
type QueryServer ¶
type QueryServer interface { // EpochInfos provide running epochInfos EpochInfos(context.Context, *QueryEpochInfosRequest) (*QueryEpochInfosResponse, error) // CurrentEpoch provide current epoch of specified identifier CurrentEpoch(context.Context, *QueryCurrentEpochRequest) (*QueryCurrentEpochResponse, error) }
QueryServer is the server API for Query service.
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.
func (*UnimplementedQueryServer) CurrentEpoch ¶
func (*UnimplementedQueryServer) CurrentEpoch(ctx context.Context, req *QueryCurrentEpochRequest) (*QueryCurrentEpochResponse, error)
func (*UnimplementedQueryServer) EpochInfos ¶
func (*UnimplementedQueryServer) EpochInfos(ctx context.Context, req *QueryEpochInfosRequest) (*QueryEpochInfosResponse, error)