queryproto

package
v0.1.0-merlin.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package queryproto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

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")
)

Functions

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)

Types

type QueryClient

type QueryClient interface {
	RecoveredSinceDowntimeOfLength(ctx context.Context, in *RecoveredSinceDowntimeOfLengthRequest, opts ...grpc.CallOption) (*RecoveredSinceDowntimeOfLengthResponse, 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 QueryServer

type QueryServer interface {
	RecoveredSinceDowntimeOfLength(context.Context, *RecoveredSinceDowntimeOfLengthRequest) (*RecoveredSinceDowntimeOfLengthResponse, error)
}

QueryServer is the server API for Query service.

type RecoveredSinceDowntimeOfLengthRequest

type RecoveredSinceDowntimeOfLengthRequest struct {
	Downtime types.Downtime `` /* 132-byte string literal not displayed */
	Recovery time.Duration  `protobuf:"bytes,2,opt,name=recovery,proto3,stdduration" json:"recovery" yaml:"recovery_duration"`
}

Query for has it been at least $RECOVERY_DURATION units of time, since the chain has been down for $DOWNTIME_DURATION.

func (*RecoveredSinceDowntimeOfLengthRequest) Descriptor

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

func (*RecoveredSinceDowntimeOfLengthRequest) GetDowntime

func (*RecoveredSinceDowntimeOfLengthRequest) GetRecovery

func (*RecoveredSinceDowntimeOfLengthRequest) Marshal

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

func (*RecoveredSinceDowntimeOfLengthRequest) MarshalTo

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

func (*RecoveredSinceDowntimeOfLengthRequest) MarshalToSizedBuffer

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

func (*RecoveredSinceDowntimeOfLengthRequest) ProtoMessage

func (*RecoveredSinceDowntimeOfLengthRequest) ProtoMessage()

func (*RecoveredSinceDowntimeOfLengthRequest) Reset

func (*RecoveredSinceDowntimeOfLengthRequest) Size

func (*RecoveredSinceDowntimeOfLengthRequest) String

func (*RecoveredSinceDowntimeOfLengthRequest) Unmarshal

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

func (*RecoveredSinceDowntimeOfLengthRequest) XXX_DiscardUnknown

func (m *RecoveredSinceDowntimeOfLengthRequest) XXX_DiscardUnknown()

func (*RecoveredSinceDowntimeOfLengthRequest) XXX_Marshal

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

func (*RecoveredSinceDowntimeOfLengthRequest) XXX_Merge

func (*RecoveredSinceDowntimeOfLengthRequest) XXX_Size

func (*RecoveredSinceDowntimeOfLengthRequest) XXX_Unmarshal

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

type RecoveredSinceDowntimeOfLengthResponse

type RecoveredSinceDowntimeOfLengthResponse struct {
	SuccesfullyRecovered bool `protobuf:"varint,1,opt,name=succesfully_recovered,json=succesfullyRecovered,proto3" json:"succesfully_recovered,omitempty"`
}

func (*RecoveredSinceDowntimeOfLengthResponse) Descriptor

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

func (*RecoveredSinceDowntimeOfLengthResponse) GetSuccesfullyRecovered

func (m *RecoveredSinceDowntimeOfLengthResponse) GetSuccesfullyRecovered() bool

func (*RecoveredSinceDowntimeOfLengthResponse) Marshal

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

func (*RecoveredSinceDowntimeOfLengthResponse) MarshalTo

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

func (*RecoveredSinceDowntimeOfLengthResponse) MarshalToSizedBuffer

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

func (*RecoveredSinceDowntimeOfLengthResponse) ProtoMessage

func (*RecoveredSinceDowntimeOfLengthResponse) Reset

func (*RecoveredSinceDowntimeOfLengthResponse) Size

func (*RecoveredSinceDowntimeOfLengthResponse) String

func (*RecoveredSinceDowntimeOfLengthResponse) Unmarshal

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

func (*RecoveredSinceDowntimeOfLengthResponse) XXX_DiscardUnknown

func (m *RecoveredSinceDowntimeOfLengthResponse) XXX_DiscardUnknown()

func (*RecoveredSinceDowntimeOfLengthResponse) XXX_Marshal

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

func (*RecoveredSinceDowntimeOfLengthResponse) XXX_Merge

func (*RecoveredSinceDowntimeOfLengthResponse) XXX_Size

func (*RecoveredSinceDowntimeOfLengthResponse) XXX_Unmarshal

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

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

Jump to

Keyboard shortcuts

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