v1

package
v1.3.41 Latest Latest
Warning

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

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

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EntryService_GetName_FullMethodName     = "/protos.edge.entry.v1.EntryService/GetName"
	EntryService_ShouldEnter_FullMethodName = "/protos.edge.entry.v1.EntryService/ShouldEnter"
)

Variables

View Source
var EntryService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "protos.edge.entry.v1.EntryService",
	HandlerType: (*EntryServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetName",
			Handler:    _EntryService_GetName_Handler,
		},
		{
			MethodName: "ShouldEnter",
			Handler:    _EntryService_ShouldEnter_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "protos/edge/entry/v1/service.proto",
}

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

View Source
var File_protos_edge_entry_v1_service_proto protoreflect.FileDescriptor

Functions

func RegisterEntryServiceHandler

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

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

func RegisterEntryServiceHandlerClient

func RegisterEntryServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EntryServiceClient) error

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

func RegisterEntryServiceHandlerFromEndpoint

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

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

func RegisterEntryServiceHandlerServer

func RegisterEntryServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EntryServiceServer) error

RegisterEntryServiceHandlerServer registers the http handlers for service EntryService to "mux". UnaryRPC :call EntryServiceServer 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 RegisterEntryServiceHandlerFromEndpoint instead.

func RegisterEntryServiceServer

func RegisterEntryServiceServer(s grpc.ServiceRegistrar, srv EntryServiceServer)

Types

type EntryRequest

type EntryRequest struct {
	Context *data.StrategyContext `protobuf:"bytes,1,opt,name=context,proto3" json:"context,omitempty"`                                      // The strategy context that contains information associated with the currently-running strategy
	Allowed data.AllowedTrades    `protobuf:"varint,2,opt,name=allowed,proto3,enum=protos.edge.data.AllowedTrades" json:"allowed,omitempty"` // Which trades should be allowed by the filter
	// contains filtered or unexported fields
}

EntryRequest describes the information that may be used to inform whether or not a position should be entered. No modifications made by the endpoint will be reflected in the data.

func (*EntryRequest) Descriptor deprecated

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

Deprecated: Use EntryRequest.ProtoReflect.Descriptor instead.

func (*EntryRequest) GetAllowed added in v1.3.4

func (x *EntryRequest) GetAllowed() data.AllowedTrades

func (*EntryRequest) GetContext

func (x *EntryRequest) GetContext() *data.StrategyContext

func (*EntryRequest) ProtoMessage

func (*EntryRequest) ProtoMessage()

func (*EntryRequest) ProtoReflect

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

func (*EntryRequest) Reset

func (x *EntryRequest) Reset()

func (*EntryRequest) String

func (x *EntryRequest) String() string

type EntryResult

type EntryResult struct {
	ShouldEnter bool                 `protobuf:"varint,1,opt,name=should_enter,json=shouldEnter,proto3" json:"should_enter,omitempty"` // Whether or not the position should be entered. True, to enter. False to ignore.
	Order       []*data.TradeRequest `protobuf:"bytes,2,rep,name=order,proto3" json:"order,omitempty"`                                 // The order that represents the position that should be entered. This value will be empty if should_enter is false. Furthermore, the order may be modified by other modules before being submitted.
	// contains filtered or unexported fields
}

EntryResult contains the information that should be returned after an entry decision has been reached and will be used to inform the strategy runner about which action should be taken next.

func (*EntryResult) Descriptor deprecated

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

Deprecated: Use EntryResult.ProtoReflect.Descriptor instead.

func (*EntryResult) GetOrder

func (x *EntryResult) GetOrder() []*data.TradeRequest

func (*EntryResult) GetShouldEnter

func (x *EntryResult) GetShouldEnter() bool

func (*EntryResult) ProtoMessage

func (*EntryResult) ProtoMessage()

func (*EntryResult) ProtoReflect

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

func (*EntryResult) Reset

func (x *EntryResult) Reset()

func (*EntryResult) String

func (x *EntryResult) String() string

type EntryServiceClient

type EntryServiceClient interface {
	// GetName retrieves an identifier associated with the service, allowing the strategy runner to
	// uniquely identify it when multiple filter services are being referenced. It will return a
	// name result showing the address, ID and human-readable name of the filter service that processed
	// the original request.
	GetName(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*data.NameResult, error)
	// ShouldEnter determines whether or not a position should be entered, using the data contained in
	// the EntryRequest. This endpoint will return an EntryResult, that shows the entry decision and
	// the order that should be submitted to the trade service.
	ShouldEnter(ctx context.Context, in *EntryRequest, opts ...grpc.CallOption) (*EntryResult, error)
}

EntryServiceClient is the client API for EntryService 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 EntryServiceServer

type EntryServiceServer interface {
	// GetName retrieves an identifier associated with the service, allowing the strategy runner to
	// uniquely identify it when multiple filter services are being referenced. It will return a
	// name result showing the address, ID and human-readable name of the filter service that processed
	// the original request.
	GetName(context.Context, *empty.Empty) (*data.NameResult, error)
	// ShouldEnter determines whether or not a position should be entered, using the data contained in
	// the EntryRequest. This endpoint will return an EntryResult, that shows the entry decision and
	// the order that should be submitted to the trade service.
	ShouldEnter(context.Context, *EntryRequest) (*EntryResult, error)
	// contains filtered or unexported methods
}

EntryServiceServer is the server API for EntryService service. All implementations must embed UnimplementedEntryServiceServer for forward compatibility

type UnimplementedEntryServiceServer

type UnimplementedEntryServiceServer struct {
}

UnimplementedEntryServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedEntryServiceServer) GetName

func (UnimplementedEntryServiceServer) ShouldEnter

type UnsafeEntryServiceServer

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

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

Jump to

Keyboard shortcuts

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