Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc1.Server, srv ServiceServer)
- type CfgOption
- type Config
- type Handler
- func (*Handler) Descriptor() ([]byte, []int)
- func (m *Handler) GetRequestName() string
- func (m *Handler) GetResponseName() string
- func (m *Handler) Marshal() (dAtA []byte, err error)
- func (m *Handler) MarshalTo(dAtA []byte) (int, error)
- func (m *Handler) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Handler) ProtoMessage()
- func (m *Handler) Reset()
- func (m *Handler) Size() (n int)
- func (m *Handler) String() string
- func (m *Handler) Unmarshal(dAtA []byte) error
- func (m *Handler) XXX_DiscardUnknown()
- func (m *Handler) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Handler) XXX_Merge(src proto.Message)
- func (m *Handler) XXX_Size() int
- func (m *Handler) XXX_Unmarshal(b []byte) error
- type ListQueryHandlersRequest
- func (*ListQueryHandlersRequest) Descriptor() ([]byte, []int)
- func (m *ListQueryHandlersRequest) Marshal() (dAtA []byte, err error)
- func (m *ListQueryHandlersRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *ListQueryHandlersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ListQueryHandlersRequest) ProtoMessage()
- func (m *ListQueryHandlersRequest) Reset()
- func (m *ListQueryHandlersRequest) Size() (n int)
- func (m *ListQueryHandlersRequest) String() string
- func (m *ListQueryHandlersRequest) Unmarshal(dAtA []byte) error
- func (m *ListQueryHandlersRequest) XXX_DiscardUnknown()
- func (m *ListQueryHandlersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ListQueryHandlersRequest) XXX_Merge(src proto.Message)
- func (m *ListQueryHandlersRequest) XXX_Size() int
- func (m *ListQueryHandlersRequest) XXX_Unmarshal(b []byte) error
- type ListQueryHandlersResponse
- func (*ListQueryHandlersResponse) Descriptor() ([]byte, []int)
- func (m *ListQueryHandlersResponse) GetHandlers() []*Handler
- func (m *ListQueryHandlersResponse) Marshal() (dAtA []byte, err error)
- func (m *ListQueryHandlersResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *ListQueryHandlersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ListQueryHandlersResponse) ProtoMessage()
- func (m *ListQueryHandlersResponse) Reset()
- func (m *ListQueryHandlersResponse) Size() (n int)
- func (m *ListQueryHandlersResponse) String() string
- func (m *ListQueryHandlersResponse) Unmarshal(dAtA []byte) error
- func (m *ListQueryHandlersResponse) XXX_DiscardUnknown()
- func (m *ListQueryHandlersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ListQueryHandlersResponse) XXX_Merge(src proto.Message)
- func (m *ListQueryHandlersResponse) XXX_Size() int
- func (m *ListQueryHandlersResponse) XXX_Unmarshal(b []byte) error
- type OptionFunc
- type QueryRequest
- func (*QueryRequest) Descriptor() ([]byte, []int)
- func (m *QueryRequest) GetRequest() *any.Any
- func (m *QueryRequest) Marshal() (dAtA []byte, err error)
- func (m *QueryRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryRequest) ProtoMessage()
- func (m *QueryRequest) Reset()
- func (m *QueryRequest) Size() (n int)
- func (m *QueryRequest) String() string
- func (m *QueryRequest) Unmarshal(dAtA []byte) error
- func (m *QueryRequest) XXX_DiscardUnknown()
- func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryRequest) XXX_Merge(src proto.Message)
- func (m *QueryRequest) XXX_Size() int
- func (m *QueryRequest) XXX_Unmarshal(b []byte) error
- type QueryResponse
- func (*QueryResponse) Descriptor() ([]byte, []int)
- func (m *QueryResponse) GetResponse() *any.Any
- func (m *QueryResponse) Marshal() (dAtA []byte, err error)
- func (m *QueryResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*QueryResponse) ProtoMessage()
- func (m *QueryResponse) Reset()
- func (m *QueryResponse) Size() (n int)
- func (m *QueryResponse) String() string
- func (m *QueryResponse) Unmarshal(dAtA []byte) error
- func (m *QueryResponse) XXX_DiscardUnknown()
- func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *QueryResponse) XXX_Merge(src proto.Message)
- func (m *QueryResponse) XXX_Size() int
- func (m *QueryResponse) XXX_Unmarshal(b []byte) error
- type Server
- type ServiceClient
- type ServiceServer
- type UnimplementedServiceServer
Constants ¶
const ( ServerName = "grpc" BlockHeightHeader = "x-cosmos-block-height" )
Variables ¶
var ( ErrInvalidLengthService = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowService = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group") )
var FlagAddress = prefix("address")
var Service_serviceDesc = _Service_serviceDesc
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc1.Server, srv ServiceServer)
Types ¶
type CfgOption ¶
type CfgOption func(*Config)
CfgOption is a function that allows to overwrite the default server configuration.
func Disable ¶
func Disable() CfgOption
Disable the grpc-gateway server by default (default enabled).
func OverwriteDefaultConfig ¶
OverwriteDefaultConfig overwrites the default config with the new config.
type Config ¶
type Config struct { // Enable defines if the gRPC server should be enabled. Enable bool `mapstructure:"enable" toml:"enable" comment:"Enable defines if the gRPC server should be enabled."` // Address defines the API server to listen on Address string `mapstructure:"address" toml:"address" comment:"Address defines the gRPC server address to bind to."` // MaxRecvMsgSize defines the max message size in bytes the server can receive. // The default value is 10MB. MaxRecvMsgSize int `` /* 172-byte string literal not displayed */ // MaxSendMsgSize defines the max message size in bytes the server can send. // The default value is math.MaxInt32. MaxSendMsgSize int `` /* 178-byte string literal not displayed */ }
Config defines configuration for the gRPC server.
func DefaultConfig ¶
func DefaultConfig() *Config
type Handler ¶
type Handler struct { RequestName string `protobuf:"bytes,1,opt,name=request_name,json=requestName,proto3" json:"request_name,omitempty"` ResponseName string `protobuf:"bytes,2,opt,name=response_name,json=responseName,proto3" json:"response_name,omitempty"` }
Handler defines a query handler
func (*Handler) Descriptor ¶
func (*Handler) GetRequestName ¶
func (*Handler) GetResponseName ¶
func (*Handler) MarshalToSizedBuffer ¶
func (*Handler) ProtoMessage ¶
func (*Handler) ProtoMessage()
func (*Handler) XXX_DiscardUnknown ¶
func (m *Handler) XXX_DiscardUnknown()
func (*Handler) XXX_Marshal ¶
func (*Handler) XXX_Unmarshal ¶
type ListQueryHandlersRequest ¶
type ListQueryHandlersRequest struct { }
ListQueryHandlersRequest is the request for the ListQueryHandlers method
func (*ListQueryHandlersRequest) Descriptor ¶
func (*ListQueryHandlersRequest) Descriptor() ([]byte, []int)
func (*ListQueryHandlersRequest) Marshal ¶
func (m *ListQueryHandlersRequest) Marshal() (dAtA []byte, err error)
func (*ListQueryHandlersRequest) MarshalTo ¶
func (m *ListQueryHandlersRequest) MarshalTo(dAtA []byte) (int, error)
func (*ListQueryHandlersRequest) MarshalToSizedBuffer ¶
func (m *ListQueryHandlersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ListQueryHandlersRequest) ProtoMessage ¶
func (*ListQueryHandlersRequest) ProtoMessage()
func (*ListQueryHandlersRequest) Reset ¶
func (m *ListQueryHandlersRequest) Reset()
func (*ListQueryHandlersRequest) Size ¶
func (m *ListQueryHandlersRequest) Size() (n int)
func (*ListQueryHandlersRequest) String ¶
func (m *ListQueryHandlersRequest) String() string
func (*ListQueryHandlersRequest) Unmarshal ¶
func (m *ListQueryHandlersRequest) Unmarshal(dAtA []byte) error
func (*ListQueryHandlersRequest) XXX_DiscardUnknown ¶
func (m *ListQueryHandlersRequest) XXX_DiscardUnknown()
func (*ListQueryHandlersRequest) XXX_Marshal ¶
func (m *ListQueryHandlersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ListQueryHandlersRequest) XXX_Merge ¶
func (m *ListQueryHandlersRequest) XXX_Merge(src proto.Message)
func (*ListQueryHandlersRequest) XXX_Size ¶
func (m *ListQueryHandlersRequest) XXX_Size() int
func (*ListQueryHandlersRequest) XXX_Unmarshal ¶
func (m *ListQueryHandlersRequest) XXX_Unmarshal(b []byte) error
type ListQueryHandlersResponse ¶
type ListQueryHandlersResponse struct {
Handlers []*Handler `protobuf:"bytes,1,rep,name=handlers,proto3" json:"handlers,omitempty"`
}
ListQueryHandlersResponse is the response for the ListQueryHandlers method
func (*ListQueryHandlersResponse) Descriptor ¶
func (*ListQueryHandlersResponse) Descriptor() ([]byte, []int)
func (*ListQueryHandlersResponse) GetHandlers ¶
func (m *ListQueryHandlersResponse) GetHandlers() []*Handler
func (*ListQueryHandlersResponse) Marshal ¶
func (m *ListQueryHandlersResponse) Marshal() (dAtA []byte, err error)
func (*ListQueryHandlersResponse) MarshalTo ¶
func (m *ListQueryHandlersResponse) MarshalTo(dAtA []byte) (int, error)
func (*ListQueryHandlersResponse) MarshalToSizedBuffer ¶
func (m *ListQueryHandlersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ListQueryHandlersResponse) ProtoMessage ¶
func (*ListQueryHandlersResponse) ProtoMessage()
func (*ListQueryHandlersResponse) Reset ¶
func (m *ListQueryHandlersResponse) Reset()
func (*ListQueryHandlersResponse) Size ¶
func (m *ListQueryHandlersResponse) Size() (n int)
func (*ListQueryHandlersResponse) String ¶
func (m *ListQueryHandlersResponse) String() string
func (*ListQueryHandlersResponse) Unmarshal ¶
func (m *ListQueryHandlersResponse) Unmarshal(dAtA []byte) error
func (*ListQueryHandlersResponse) XXX_DiscardUnknown ¶
func (m *ListQueryHandlersResponse) XXX_DiscardUnknown()
func (*ListQueryHandlersResponse) XXX_Marshal ¶
func (m *ListQueryHandlersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ListQueryHandlersResponse) XXX_Merge ¶
func (m *ListQueryHandlersResponse) XXX_Merge(src proto.Message)
func (*ListQueryHandlersResponse) XXX_Size ¶
func (m *ListQueryHandlersResponse) XXX_Size() int
func (*ListQueryHandlersResponse) XXX_Unmarshal ¶
func (m *ListQueryHandlersResponse) XXX_Unmarshal(b []byte) error
type OptionFunc ¶
type OptionFunc[T transaction.Tx] func(*Server[T])
func WithCfgOptions ¶
func WithCfgOptions[T transaction.Tx](cfgOptions ...CfgOption) OptionFunc[T]
WithCfgOptions allows to overwrite the default server configuration.
func WithExtraGRPCHandlers ¶
func WithExtraGRPCHandlers[T transaction.Tx](handlers ...func(*grpc.Server) error) OptionFunc[T]
WithExtraGRPCHandlers allows to register extra handlers on the grpc server.
type QueryRequest ¶
type QueryRequest struct {
Request *any.Any `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
}
QueryRequest is the request for the Query method
func (*QueryRequest) Descriptor ¶
func (*QueryRequest) Descriptor() ([]byte, []int)
func (*QueryRequest) GetRequest ¶
func (m *QueryRequest) GetRequest() *any.Any
func (*QueryRequest) Marshal ¶
func (m *QueryRequest) Marshal() (dAtA []byte, err error)
func (*QueryRequest) MarshalToSizedBuffer ¶
func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryRequest) ProtoMessage ¶
func (*QueryRequest) ProtoMessage()
func (*QueryRequest) Reset ¶
func (m *QueryRequest) Reset()
func (*QueryRequest) Size ¶
func (m *QueryRequest) Size() (n int)
func (*QueryRequest) String ¶
func (m *QueryRequest) String() string
func (*QueryRequest) Unmarshal ¶
func (m *QueryRequest) Unmarshal(dAtA []byte) error
func (*QueryRequest) XXX_DiscardUnknown ¶
func (m *QueryRequest) XXX_DiscardUnknown()
func (*QueryRequest) XXX_Marshal ¶
func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryRequest) XXX_Merge ¶
func (m *QueryRequest) XXX_Merge(src proto.Message)
func (*QueryRequest) XXX_Size ¶
func (m *QueryRequest) XXX_Size() int
func (*QueryRequest) XXX_Unmarshal ¶
func (m *QueryRequest) XXX_Unmarshal(b []byte) error
type QueryResponse ¶
type QueryResponse struct {
Response *any.Any `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"`
}
QueryResponse is the response for the Query method
func (*QueryResponse) Descriptor ¶
func (*QueryResponse) Descriptor() ([]byte, []int)
func (*QueryResponse) GetResponse ¶
func (m *QueryResponse) GetResponse() *any.Any
func (*QueryResponse) Marshal ¶
func (m *QueryResponse) Marshal() (dAtA []byte, err error)
func (*QueryResponse) MarshalToSizedBuffer ¶
func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*QueryResponse) ProtoMessage ¶
func (*QueryResponse) ProtoMessage()
func (*QueryResponse) Reset ¶
func (m *QueryResponse) Reset()
func (*QueryResponse) Size ¶
func (m *QueryResponse) Size() (n int)
func (*QueryResponse) String ¶
func (m *QueryResponse) String() string
func (*QueryResponse) Unmarshal ¶
func (m *QueryResponse) Unmarshal(dAtA []byte) error
func (*QueryResponse) XXX_DiscardUnknown ¶
func (m *QueryResponse) XXX_DiscardUnknown()
func (*QueryResponse) XXX_Marshal ¶
func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*QueryResponse) XXX_Merge ¶
func (m *QueryResponse) XXX_Merge(src proto.Message)
func (*QueryResponse) XXX_Size ¶
func (m *QueryResponse) XXX_Size() int
func (*QueryResponse) XXX_Unmarshal ¶
func (m *QueryResponse) XXX_Unmarshal(b []byte) error
type Server ¶
type Server[T transaction.Tx] struct { // contains filtered or unexported fields }
func New ¶
func New[T transaction.Tx]( logger log.Logger, interfaceRegistry server.InterfaceRegistry, queryHandlers map[string]appmodulev2.Handler, queryable func(ctx context.Context, version uint64, msg transaction.Msg) (transaction.Msg, error), cfg server.ConfigMap, opts ...OptionFunc[T], ) (*Server[T], error)
New creates a new grpc server.
func NewWithConfigOptions ¶
func NewWithConfigOptions[T transaction.Tx](opts ...CfgOption) *Server[T]
NewWithConfigOptions creates a new GRPC server with the provided config options. It is *not* a fully functional server (since it has been created without dependencies) The returned server should only be used to get and set configuration.
func (*Server[T]) StartCmdFlags ¶
type ServiceClient ¶
type ServiceClient interface { // Query queries the server with a request, the request can be any sdk Msg. Query(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) // ListQueryHandlers lists all the available query handlers. ListQueryHandlers(ctx context.Context, in *ListQueryHandlersRequest, opts ...grpc.CallOption) (*ListQueryHandlersResponse, error) }
ServiceClient is the client API for Service service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewServiceClient ¶
func NewServiceClient(cc grpc1.ClientConn) ServiceClient
type ServiceServer ¶
type ServiceServer interface { // Query queries the server with a request, the request can be any sdk Msg. Query(context.Context, *QueryRequest) (*QueryResponse, error) // ListQueryHandlers lists all the available query handlers. ListQueryHandlers(context.Context, *ListQueryHandlersRequest) (*ListQueryHandlersResponse, error) }
ServiceServer is the server API for Service service.
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct { }
UnimplementedServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedServiceServer) ListQueryHandlers ¶
func (*UnimplementedServiceServer) ListQueryHandlers(ctx context.Context, req *ListQueryHandlersRequest) (*ListQueryHandlersResponse, error)
func (*UnimplementedServiceServer) Query ¶
func (*UnimplementedServiceServer) Query(ctx context.Context, req *QueryRequest) (*QueryResponse, error)
Directories ¶
Path | Synopsis |
---|---|
Package gogoreflection implements gRPC reflection for gogoproto consumers the normal reflection library does not work as it points to a different singleton registry.
|
Package gogoreflection implements gRPC reflection for gogoproto consumers the normal reflection library does not work as it points to a different singleton registry. |