v1

package
v1.2.31 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: Unlicense Imports: 18 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	OhlcService_Aggregates_FullMethodName = "/protos.frontend.ohlc.v1.OhlcService/Aggregates"
)

Variables

View Source
var File_protos_frontend_ohlc_v1_service_proto protoreflect.FileDescriptor
View Source
var OhlcService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "protos.frontend.ohlc.v1.OhlcService",
	HandlerType: (*OhlcServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Aggregates",
			Handler:       _OhlcService_Aggregates_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "protos/frontend/ohlc/v1/service.proto",
}

OhlcService_ServiceDesc is the grpc.ServiceDesc for OhlcService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterOhlcServiceHandler

func RegisterOhlcServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterOhlcServiceHandler registers the http handlers for service OhlcService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterOhlcServiceHandlerClient

func RegisterOhlcServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OhlcServiceClient) error

RegisterOhlcServiceHandlerClient registers the http handlers for service OhlcService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OhlcServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OhlcServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "OhlcServiceClient" to call the correct interceptors.

func RegisterOhlcServiceHandlerFromEndpoint

func RegisterOhlcServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterOhlcServiceHandlerFromEndpoint is same as RegisterOhlcServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterOhlcServiceHandlerServer

func RegisterOhlcServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OhlcServiceServer) error

RegisterOhlcServiceHandlerServer registers the http handlers for service OhlcService to "mux". UnaryRPC :call OhlcServiceServer 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 RegisterOhlcServiceHandlerFromEndpoint instead.

func RegisterOhlcServiceServer

func RegisterOhlcServiceServer(s grpc.ServiceRegistrar, srv OhlcServiceServer)

Types

type GetAggregatesRequest

type GetAggregatesRequest 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 starting time (inclusive) from which to pull aggregated data as a timestamp. This value will
	// be snapped to the start of the time period dictated by the frequency parameter (start of the
	// second, minute, hour, day, etc. indicated).
	From *gopb.UnixTimestamp `protobuf:"bytes,2,opt,name=from,proto3" json:"from"`
	// The ending time (exclusive) until which to pull aggregated data as a timestamp. This value will
	// be snapped to the end of the time period dictated by the frequency parameter (end of the second,
	// minute, hour, day, etc. indicated) and then will be stretched so that a full bar can be returned,
	// when taking into account the multiplier.
	To *gopb.UnixTimestamp `protobuf:"bytes,3,opt,name=to,proto3" json:"to"`
	// The symbol of the asset for which data was being requested
	Symbol string `protobuf:"bytes,4,opt,name=symbol,proto3" json:"symbol,omitempty"`
	// The multiplier to associate with the frequency to describe the size of the bar being requested
	Multiplier uint32 `protobuf:"varint,5,opt,name=multiplier,proto3" json:"multiplier,omitempty"`
	// The frequency with which bars should be requested. This value is used together with the multiplier
	// to describe the size of the bar
	Frequency data.Frequency `protobuf:"varint,6,opt,name=frequency,proto3,enum=protos.frontend.data.Frequency" json:"frequency"`
	// Whether or not the aggregated data should be adjusted for splits. This is the functionality by default.
	// If it is disabled, then the pricing and volume information will not be adjusted to account for splits.
	UnadjustSplits bool `protobuf:"varint,7,opt,name=unadjust_splits,json=unadjustSplits,proto3" json:"unadjust_splits,omitempty"`
	// contains filtered or unexported fields
}

Describes a request to get aggregated trades data.

func (*GetAggregatesRequest) Descriptor deprecated

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

Deprecated: Use GetAggregatesRequest.ProtoReflect.Descriptor instead.

func (*GetAggregatesRequest) GetFrequency

func (x *GetAggregatesRequest) GetFrequency() data.Frequency

func (*GetAggregatesRequest) GetFrom

func (x *GetAggregatesRequest) GetFrom() *gopb.UnixTimestamp

func (*GetAggregatesRequest) GetMultiplier

func (x *GetAggregatesRequest) GetMultiplier() uint32

func (*GetAggregatesRequest) GetProviderId added in v1.2.4

func (x *GetAggregatesRequest) GetProviderId() gopb.Provider

func (*GetAggregatesRequest) GetSymbol

func (x *GetAggregatesRequest) GetSymbol() string

func (*GetAggregatesRequest) GetTo

func (*GetAggregatesRequest) GetUnadjustSplits

func (x *GetAggregatesRequest) GetUnadjustSplits() bool

func (*GetAggregatesRequest) ProtoMessage

func (*GetAggregatesRequest) ProtoMessage()

func (*GetAggregatesRequest) ProtoReflect

func (x *GetAggregatesRequest) ProtoReflect() protoreflect.Message

func (*GetAggregatesRequest) Reset

func (x *GetAggregatesRequest) Reset()

func (*GetAggregatesRequest) String

func (x *GetAggregatesRequest) String() string

type OhlcServiceClient

type OhlcServiceClient interface {
	// Retrieves aggregated trading data over the time period, for the symbol and time frequency provided.
	// 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 multiplier is negative, the frequency is invalid or the start time (from) comes
	// after the end time (to). If the time range contains part of a bar then request can contain a
	// flag to either pull in that extra bar or ignore it. This endpoint will adjust for splits by default.
	// If this functionality is not necessary then the associated flag should be set. This data will,
	// in the case of small bars, aggregate trades data directly. However, when data adjusted for splits
	// is requested on a timeframes larger than one day, the data will be aggregated to a daily timeframe
	// and then aggregated again. This is to account for splits.
	Aggregates(ctx context.Context, in *GetAggregatesRequest, opts ...grpc.CallOption) (OhlcService_AggregatesClient, error)
}

OhlcServiceClient is the client API for OhlcService 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.

type OhlcServiceServer

type OhlcServiceServer interface {
	// Retrieves aggregated trading data over the time period, for the symbol and time frequency provided.
	// 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 multiplier is negative, the frequency is invalid or the start time (from) comes
	// after the end time (to). If the time range contains part of a bar then request can contain a
	// flag to either pull in that extra bar or ignore it. This endpoint will adjust for splits by default.
	// If this functionality is not necessary then the associated flag should be set. This data will,
	// in the case of small bars, aggregate trades data directly. However, when data adjusted for splits
	// is requested on a timeframes larger than one day, the data will be aggregated to a daily timeframe
	// and then aggregated again. This is to account for splits.
	Aggregates(*GetAggregatesRequest, OhlcService_AggregatesServer) error
	// contains filtered or unexported methods
}

OhlcServiceServer is the server API for OhlcService service. All implementations must embed UnimplementedOhlcServiceServer for forward compatibility

type OhlcService_AggregatesClient

type OhlcService_AggregatesClient interface {
	Recv() (*data.Bar, error)
	grpc.ClientStream
}

type OhlcService_AggregatesServer

type OhlcService_AggregatesServer interface {
	Send(*data.Bar) error
	grpc.ServerStream
}

type UnimplementedOhlcServiceServer

type UnimplementedOhlcServiceServer struct {
}

UnimplementedOhlcServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedOhlcServiceServer) Aggregates

type UnsafeOhlcServiceServer

type UnsafeOhlcServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeOhlcServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OhlcServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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