Documentation ¶
Overview ¶
Package split is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- 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)
- type QueryClient
- type QueryRequest
- func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error)
- func (*QueryRequest) Descriptor() ([]byte, []int)
- func (queryRequest *QueryRequest) Encode() ([]byte, error)
- func (*QueryRequest) FromCLI(cliCommand helpers.CLICommand, _ client.Context) (helpers.QueryRequest, error)
- func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRequest, error)
- func (m *QueryRequest) GetKey() *key.Key
- 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 (queryRequest *QueryRequest) Validate() 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 *QueryResponse) Decode(bytes []byte) (helpers.QueryResponse, error)
- func (*QueryResponse) Descriptor() ([]byte, []int)
- func (queryResponse *QueryResponse) Encode() ([]byte, error)
- 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 QueryServer
- type UnimplementedQueryServer
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthQueryRequest = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowQueryRequest = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupQueryRequest = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthQueryResponse = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowQueryResponse = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupQueryResponse = fmt.Errorf("proto: unexpected end of group") )
var Query = baseHelpers.NewQuery( name.GetPackageName(dummy{}), "", "", constants.ModuleName, requestPrototype, responsePrototype, keeperPrototype, func(server grpc.Server, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, helperConstants.SplitID, )
Functions ¶
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)
Types ¶
type QueryClient ¶
type QueryClient interface {
Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, 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 QueryRequest ¶
type QueryRequest struct {
Key *key.Key `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
}
func (*QueryRequest) Decode ¶
func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error)
func (*QueryRequest) Descriptor ¶
func (*QueryRequest) Descriptor() ([]byte, []int)
func (*QueryRequest) Encode ¶
func (queryRequest *QueryRequest) Encode() ([]byte, error)
func (*QueryRequest) FromCLI ¶
func (*QueryRequest) FromCLI(cliCommand helpers.CLICommand, _ client.Context) (helpers.QueryRequest, error)
func (*QueryRequest) FromHTTPRequest ¶
func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRequest, error)
func (*QueryRequest) GetKey ¶
func (m *QueryRequest) GetKey() *key.Key
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) Validate ¶
func (queryRequest *QueryRequest) Validate() error
Validate godoc @Summary Query split using split id @Description Able to query the asset @Accept json @Produce json @Tags Splits @Param splitID path string true "split ID" @Success 200 {object} queryResponse "Message for a successful query response" @Failure default {object} queryResponse "Message for an unexpected error response." @Router /splits/splits/{splitID} [get]
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 {
Record *record.Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"`
}
func (*QueryResponse) Decode ¶
func (queryResponse *QueryResponse) Decode(bytes []byte) (helpers.QueryResponse, error)
func (*QueryResponse) Descriptor ¶
func (*QueryResponse) Descriptor() ([]byte, []int)
func (*QueryResponse) Encode ¶
func (queryResponse *QueryResponse) Encode() ([]byte, error)
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 QueryServer ¶
type QueryServer interface {
Handle(context.Context, *QueryRequest) (*QueryResponse, 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) Handle ¶
func (*UnimplementedQueryServer) Handle(ctx context.Context, req *QueryRequest) (*QueryResponse, error)