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 (
	RiskManagementService_GetName_FullMethodName     = "/protos.edge.risk.v1.RiskManagementService/GetName"
	RiskManagementService_ModifyOrder_FullMethodName = "/protos.edge.risk.v1.RiskManagementService/ModifyOrder"
)

Variables

View Source
var File_protos_edge_risk_v1_service_proto protoreflect.FileDescriptor
View Source
var RiskManagementService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "protos.edge.risk.v1.RiskManagementService",
	HandlerType: (*RiskManagementServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetName",
			Handler:    _RiskManagementService_GetName_Handler,
		},
		{
			MethodName: "ModifyOrder",
			Handler:    _RiskManagementService_ModifyOrder_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "protos/edge/risk/v1/service.proto",
}

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

Functions

func RegisterRiskManagementServiceHandler

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

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

func RegisterRiskManagementServiceHandlerClient

func RegisterRiskManagementServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RiskManagementServiceClient) error

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

func RegisterRiskManagementServiceHandlerFromEndpoint

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

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

func RegisterRiskManagementServiceHandlerServer

func RegisterRiskManagementServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RiskManagementServiceServer) error

RegisterRiskManagementServiceHandlerServer registers the http handlers for service RiskManagementService to "mux". UnaryRPC :call RiskManagementServiceServer 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 RegisterRiskManagementServiceHandlerFromEndpoint instead.

func RegisterRiskManagementServiceServer

func RegisterRiskManagementServiceServer(s grpc.ServiceRegistrar, srv RiskManagementServiceServer)

Types

type ModifyOrderRequest

type ModifyOrderRequest 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
	OriginalTrade *data.TradeRequest    `protobuf:"bytes,2,opt,name=original_trade,json=originalTrade,proto3" json:"original_trade,omitempty"` // The trade received by the service. Changes to this value will not be reflected in the sender
	// contains filtered or unexported fields
}

ModifyOrderRequest describes the information that may be used to assign a hedge to a position that will be entered. No modifications made by the endpoint will be reflected in the data.

func (*ModifyOrderRequest) Descriptor deprecated

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

Deprecated: Use ModifyOrderRequest.ProtoReflect.Descriptor instead.

func (*ModifyOrderRequest) GetContext

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

func (*ModifyOrderRequest) GetOriginalTrade

func (x *ModifyOrderRequest) GetOriginalTrade() *data.TradeRequest

func (*ModifyOrderRequest) ProtoMessage

func (*ModifyOrderRequest) ProtoMessage()

func (*ModifyOrderRequest) ProtoReflect

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

func (*ModifyOrderRequest) Reset

func (x *ModifyOrderRequest) Reset()

func (*ModifyOrderRequest) String

func (x *ModifyOrderRequest) String() string

type ModifyOrderResult

type ModifyOrderResult struct {
	Confirmed    bool               `protobuf:"varint,1,opt,name=confirmed,proto3" json:"confirmed,omitempty"`                          // Whether or not the trade is confirmed by the risk management module
	UpdatedTrade *data.TradeRequest `protobuf:"bytes,2,opt,name=updated_trade,json=updatedTrade,proto3" json:"updated_trade,omitempty"` // The trade request, updated by the service. This value will be nil if confirmed is false.
	// contains filtered or unexported fields
}

ModifyOrderResult describes the information that will be returned from the service. This will contain the updated trade request that will be submitted to the trade system on behalf of the strategy.

func (*ModifyOrderResult) Descriptor deprecated

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

Deprecated: Use ModifyOrderResult.ProtoReflect.Descriptor instead.

func (*ModifyOrderResult) GetConfirmed added in v1.3.0

func (x *ModifyOrderResult) GetConfirmed() bool

func (*ModifyOrderResult) GetUpdatedTrade

func (x *ModifyOrderResult) GetUpdatedTrade() *data.TradeRequest

func (*ModifyOrderResult) ProtoMessage

func (*ModifyOrderResult) ProtoMessage()

func (*ModifyOrderResult) ProtoReflect

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

func (*ModifyOrderResult) Reset

func (x *ModifyOrderResult) Reset()

func (*ModifyOrderResult) String

func (x *ModifyOrderResult) String() string

type RiskManagementServiceClient

type RiskManagementServiceClient 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)
	// ModifyOrder takes an existing order and modifies it to hedge against known risk. This endpoint
	// will be responsible for assigning stop-losses, take-profits, and limits as necessary. This is
	// done by taking the trade object from the ModifyOrderRequest object, making the necessary modifications,
	// and setting the associated field on the ModifyOrderResult object.
	ModifyOrder(ctx context.Context, in *ModifyOrderRequest, opts ...grpc.CallOption) (*ModifyOrderResult, error)
}

RiskManagementServiceClient is the client API for RiskManagementService 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 RiskManagementServiceServer

type RiskManagementServiceServer 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)
	// ModifyOrder takes an existing order and modifies it to hedge against known risk. This endpoint
	// will be responsible for assigning stop-losses, take-profits, and limits as necessary. This is
	// done by taking the trade object from the ModifyOrderRequest object, making the necessary modifications,
	// and setting the associated field on the ModifyOrderResult object.
	ModifyOrder(context.Context, *ModifyOrderRequest) (*ModifyOrderResult, error)
	// contains filtered or unexported methods
}

RiskManagementServiceServer is the server API for RiskManagementService service. All implementations must embed UnimplementedRiskManagementServiceServer for forward compatibility

type UnimplementedRiskManagementServiceServer

type UnimplementedRiskManagementServiceServer struct {
}

UnimplementedRiskManagementServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedRiskManagementServiceServer) GetName

func (UnimplementedRiskManagementServiceServer) ModifyOrder

type UnsafeRiskManagementServiceServer

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

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

Jump to

Keyboard shortcuts

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