Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterQuoteServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterQuoteServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QuoteServiceClient) error
- func RegisterQuoteServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterQuoteServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QuoteServiceServer) error
- func RegisterQuoteServiceServer(s grpc.ServiceRegistrar, srv QuoteServiceServer)
- type GetPriceLadderForAssetRequest
- func (*GetPriceLadderForAssetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetPriceLadderForAssetRequest) GetFrom() *gopb.UnixTimestamp
- func (x *GetPriceLadderForAssetRequest) GetProviderId() gopb.Provider
- func (x *GetPriceLadderForAssetRequest) GetSymbol() string
- func (x *GetPriceLadderForAssetRequest) GetTo() *gopb.UnixTimestamp
- func (*GetPriceLadderForAssetRequest) ProtoMessage()
- func (x *GetPriceLadderForAssetRequest) ProtoReflect() protoreflect.Message
- func (x *GetPriceLadderForAssetRequest) Reset()
- func (x *GetPriceLadderForAssetRequest) String() string
- type GetQuotesForAssetRequest
- func (*GetQuotesForAssetRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetQuotesForAssetRequest) GetFrom() *gopb.UnixTimestamp
- func (x *GetQuotesForAssetRequest) GetProviderId() gopb.Provider
- func (x *GetQuotesForAssetRequest) GetSymbol() string
- func (x *GetQuotesForAssetRequest) GetTo() *gopb.UnixTimestamp
- func (*GetQuotesForAssetRequest) ProtoMessage()
- func (x *GetQuotesForAssetRequest) ProtoReflect() protoreflect.Message
- func (x *GetQuotesForAssetRequest) Reset()
- func (x *GetQuotesForAssetRequest) String() string
- type QuoteServiceClient
- type QuoteServiceServer
- type QuoteService_GetPriceLadderForAssetClient
- type QuoteService_GetPriceLadderForAssetServer
- type QuoteService_GetQuotesForAssetClient
- type QuoteService_GetQuotesForAssetServer
- type UnimplementedQuoteServiceServer
- type UnsafeQuoteServiceServer
Constants ¶
const ( QuoteService_GetQuotesForAsset_FullMethodName = "/protos.frontend.quotes.v1.QuoteService/GetQuotesForAsset" QuoteService_GetPriceLadderForAsset_FullMethodName = "/protos.frontend.quotes.v1.QuoteService/GetPriceLadderForAsset" )
Variables ¶
var File_protos_frontend_quotes_v1_service_proto protoreflect.FileDescriptor
var QuoteService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "protos.frontend.quotes.v1.QuoteService", HandlerType: (*QuoteServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "GetQuotesForAsset", Handler: _QuoteService_GetQuotesForAsset_Handler, ServerStreams: true, }, { StreamName: "GetPriceLadderForAsset", Handler: _QuoteService_GetPriceLadderForAsset_Handler, ServerStreams: true, }, }, Metadata: "protos/frontend/quotes/v1/service.proto", }
QuoteService_ServiceDesc is the grpc.ServiceDesc for QuoteService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterQuoteServiceHandler ¶
func RegisterQuoteServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterQuoteServiceHandler registers the http handlers for service QuoteService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterQuoteServiceHandlerClient ¶
func RegisterQuoteServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QuoteServiceClient) error
RegisterQuoteServiceHandlerClient registers the http handlers for service QuoteService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QuoteServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QuoteServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QuoteServiceClient" to call the correct interceptors.
func RegisterQuoteServiceHandlerFromEndpoint ¶
func RegisterQuoteServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterQuoteServiceHandlerFromEndpoint is same as RegisterQuoteServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterQuoteServiceHandlerServer ¶
func RegisterQuoteServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QuoteServiceServer) error
RegisterQuoteServiceHandlerServer registers the http handlers for service QuoteService to "mux". UnaryRPC :call QuoteServiceServer 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 RegisterQuoteServiceHandlerFromEndpoint instead.
func RegisterQuoteServiceServer ¶
func RegisterQuoteServiceServer(s grpc.ServiceRegistrar, srv QuoteServiceServer)
Types ¶
type GetPriceLadderForAssetRequest ¶
type GetPriceLadderForAssetRequest struct { // The provider for which we want to retrieve data ProviderId gopb.Provider `protobuf:"varint,1,opt,name=provider_id,json=providerId,proto3,enum=protos.common.Provider" json:"provider_id"` // The symbol of the asset for which price-ladder data should be retrieved Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` // The starting time (inclusive) from which to request price-ladder data as a timestamp From *gopb.UnixTimestamp `protobuf:"bytes,3,opt,name=from,proto3" json:"from"` // The ending time (exclusive) until which to request price-ladder data as a timestamp To *gopb.UnixTimestamp `protobuf:"bytes,4,opt,name=to,proto3" json:"to"` // contains filtered or unexported fields }
Describes the fields on a request to get price-ladder data for an asset
func (*GetPriceLadderForAssetRequest) Descriptor
deprecated
func (*GetPriceLadderForAssetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetPriceLadderForAssetRequest.ProtoReflect.Descriptor instead.
func (*GetPriceLadderForAssetRequest) GetFrom ¶
func (x *GetPriceLadderForAssetRequest) GetFrom() *gopb.UnixTimestamp
func (*GetPriceLadderForAssetRequest) GetProviderId ¶
func (x *GetPriceLadderForAssetRequest) GetProviderId() gopb.Provider
func (*GetPriceLadderForAssetRequest) GetSymbol ¶
func (x *GetPriceLadderForAssetRequest) GetSymbol() string
func (*GetPriceLadderForAssetRequest) GetTo ¶
func (x *GetPriceLadderForAssetRequest) GetTo() *gopb.UnixTimestamp
func (*GetPriceLadderForAssetRequest) ProtoMessage ¶
func (*GetPriceLadderForAssetRequest) ProtoMessage()
func (*GetPriceLadderForAssetRequest) ProtoReflect ¶
func (x *GetPriceLadderForAssetRequest) ProtoReflect() protoreflect.Message
func (*GetPriceLadderForAssetRequest) Reset ¶
func (x *GetPriceLadderForAssetRequest) Reset()
func (*GetPriceLadderForAssetRequest) String ¶
func (x *GetPriceLadderForAssetRequest) String() string
type GetQuotesForAssetRequest ¶
type GetQuotesForAssetRequest struct { // The provider for which we want to retrieve data ProviderId gopb.Provider `protobuf:"varint,1,opt,name=provider_id,json=providerId,proto3,enum=protos.common.Provider" json:"provider_id"` // The symbol of the asset for which quotes should be retrieved Symbol string `protobuf:"bytes,2,opt,name=symbol,proto3" json:"symbol,omitempty"` // The starting time (inclusive) from which to request quotes data as a timestamp. This value will // be ignored if it is nil From *gopb.UnixTimestamp `protobuf:"bytes,3,opt,name=from,proto3" json:"from"` // The ending time (exclusive) until which to request quotes data as a timestamp. This value will // be ignored if it is nil To *gopb.UnixTimestamp `protobuf:"bytes,4,opt,name=to,proto3" json:"to"` // contains filtered or unexported fields }
Describes the fields on a request to get quotes data for an asset
func (*GetQuotesForAssetRequest) Descriptor
deprecated
func (*GetQuotesForAssetRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetQuotesForAssetRequest.ProtoReflect.Descriptor instead.
func (*GetQuotesForAssetRequest) GetFrom ¶
func (x *GetQuotesForAssetRequest) GetFrom() *gopb.UnixTimestamp
func (*GetQuotesForAssetRequest) GetProviderId ¶
func (x *GetQuotesForAssetRequest) GetProviderId() gopb.Provider
func (*GetQuotesForAssetRequest) GetSymbol ¶
func (x *GetQuotesForAssetRequest) GetSymbol() string
func (*GetQuotesForAssetRequest) GetTo ¶
func (x *GetQuotesForAssetRequest) GetTo() *gopb.UnixTimestamp
func (*GetQuotesForAssetRequest) ProtoMessage ¶
func (*GetQuotesForAssetRequest) ProtoMessage()
func (*GetQuotesForAssetRequest) ProtoReflect ¶
func (x *GetQuotesForAssetRequest) ProtoReflect() protoreflect.Message
func (*GetQuotesForAssetRequest) Reset ¶
func (x *GetQuotesForAssetRequest) Reset()
func (*GetQuotesForAssetRequest) String ¶
func (x *GetQuotesForAssetRequest) String() string
type QuoteServiceClient ¶
type QuoteServiceClient interface { // Retrieves the quotes data associated with a given asset symbol, ordered chronologically. This // endpoint will not return a not-found response if the symbol wasn't associated with any known // value. Instead, an empty list will be streamed to the client. A bad request response will be // returned if the symbol is empty or if the start time is after the end time. GetQuotesForAsset(ctx context.Context, in *GetQuotesForAssetRequest, opts ...grpc.CallOption) (QuoteService_GetQuotesForAssetClient, error) // Retrieves the price-ladder data associated with a given asset symbol, unordered. This endpoint will // not return a not-found response if the symbol wasn't associated with any known value. Instead, an // empty list will be streamed to the client. A bad request response will be returned if the symbol is // empty or if the start time is after the end time. GetPriceLadderForAsset(ctx context.Context, in *GetPriceLadderForAssetRequest, opts ...grpc.CallOption) (QuoteService_GetPriceLadderForAssetClient, error) }
QuoteServiceClient is the client API for QuoteService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewQuoteServiceClient ¶
func NewQuoteServiceClient(cc grpc.ClientConnInterface) QuoteServiceClient
type QuoteServiceServer ¶
type QuoteServiceServer interface { // Retrieves the quotes data associated with a given asset symbol, ordered chronologically. This // endpoint will not return a not-found response if the symbol wasn't associated with any known // value. Instead, an empty list will be streamed to the client. A bad request response will be // returned if the symbol is empty or if the start time is after the end time. GetQuotesForAsset(*GetQuotesForAssetRequest, QuoteService_GetQuotesForAssetServer) error // Retrieves the price-ladder data associated with a given asset symbol, unordered. This endpoint will // not return a not-found response if the symbol wasn't associated with any known value. Instead, an // empty list will be streamed to the client. A bad request response will be returned if the symbol is // empty or if the start time is after the end time. GetPriceLadderForAsset(*GetPriceLadderForAssetRequest, QuoteService_GetPriceLadderForAssetServer) error // contains filtered or unexported methods }
QuoteServiceServer is the server API for QuoteService service. All implementations must embed UnimplementedQuoteServiceServer for forward compatibility
type QuoteService_GetPriceLadderForAssetClient ¶
type QuoteService_GetPriceLadderForAssetClient interface { Recv() (*data.PriceLadderEntry, error) grpc.ClientStream }
type QuoteService_GetPriceLadderForAssetServer ¶
type QuoteService_GetPriceLadderForAssetServer interface { Send(*data.PriceLadderEntry) error grpc.ServerStream }
type QuoteService_GetQuotesForAssetClient ¶
type QuoteService_GetQuotesForAssetClient interface { Recv() (*data.Quote, error) grpc.ClientStream }
type QuoteService_GetQuotesForAssetServer ¶
type QuoteService_GetQuotesForAssetServer interface { Send(*data.Quote) error grpc.ServerStream }
type UnimplementedQuoteServiceServer ¶
type UnimplementedQuoteServiceServer struct { }
UnimplementedQuoteServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedQuoteServiceServer) GetPriceLadderForAsset ¶
func (UnimplementedQuoteServiceServer) GetPriceLadderForAsset(*GetPriceLadderForAssetRequest, QuoteService_GetPriceLadderForAssetServer) error
func (UnimplementedQuoteServiceServer) GetQuotesForAsset ¶
func (UnimplementedQuoteServiceServer) GetQuotesForAsset(*GetQuotesForAssetRequest, QuoteService_GetQuotesForAssetServer) error
type UnsafeQuoteServiceServer ¶
type UnsafeQuoteServiceServer interface {
// contains filtered or unexported methods
}
UnsafeQuoteServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to QuoteServiceServer will result in compilation errors.