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 (
	MoneyManagementService_GetName_FullMethodName     = "/protos.edge.money.v1.MoneyManagementService/GetName"
	MoneyManagementService_ModifyOrder_FullMethodName = "/protos.edge.money.v1.MoneyManagementService/ModifyOrder"
)

Variables

View Source
var File_protos_edge_money_v1_service_proto protoreflect.FileDescriptor
View Source
var MoneyManagementService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "protos.edge.money.v1.MoneyManagementService",
	HandlerType: (*MoneyManagementServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetName",
			Handler:    _MoneyManagementService_GetName_Handler,
		},
		{
			MethodName: "ModifyOrder",
			Handler:    _MoneyManagementService_ModifyOrder_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "protos/edge/money/v1/service.proto",
}

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

Functions

func RegisterMoneyManagementServiceHandler

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

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

func RegisterMoneyManagementServiceHandlerClient

func RegisterMoneyManagementServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MoneyManagementServiceClient) error

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

func RegisterMoneyManagementServiceHandlerFromEndpoint

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

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

func RegisterMoneyManagementServiceHandlerServer

func RegisterMoneyManagementServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MoneyManagementServiceServer) error

RegisterMoneyManagementServiceHandlerServer registers the http handlers for service MoneyManagementService to "mux". UnaryRPC :call MoneyManagementServiceServer 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 RegisterMoneyManagementServiceHandlerFromEndpoint instead.

func RegisterMoneyManagementServiceServer

func RegisterMoneyManagementServiceServer(s grpc.ServiceRegistrar, srv MoneyManagementServiceServer)

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 an amount of capital to a position that will be entered or exited. 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 {
	UpdatedTrade *data.TradeRequest `protobuf:"bytes,1,opt,name=updated_trade,json=updatedTrade,proto3" json:"updated_trade,omitempty"` // The trade request, updated by the service
	// 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) 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 MoneyManagementServiceClient

type MoneyManagementServiceClient interface {
	// GetName retrieves an identifier associated with the service, allowing the strategy runner to
	// uniquely identify it when multiple money-management services are being referenced. It will return
	// a name result showing the address, ID and human-readable name of the money-management 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 with liquid asset management in mind. This
	// endpoint will be responsible for assigning lot sizes, and deviation with margin and account balance
	// in mind. 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)
}

MoneyManagementServiceClient is the client API for MoneyManagementService 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 MoneyManagementServiceServer

type MoneyManagementServiceServer interface {
	// GetName retrieves an identifier associated with the service, allowing the strategy runner to
	// uniquely identify it when multiple money-management services are being referenced. It will return
	// a name result showing the address, ID and human-readable name of the money-management service
	// that processed the original request.
	GetName(context.Context, *empty.Empty) (*data.NameResult, error)
	// ModifyOrder takes an existing order and modifies it with liquid asset management in mind. This
	// endpoint will be responsible for assigning lot sizes, and deviation with margin and account balance
	// in mind. 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
}

MoneyManagementServiceServer is the server API for MoneyManagementService service. All implementations must embed UnimplementedMoneyManagementServiceServer for forward compatibility

type UnimplementedMoneyManagementServiceServer

type UnimplementedMoneyManagementServiceServer struct {
}

UnimplementedMoneyManagementServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedMoneyManagementServiceServer) GetName

func (UnimplementedMoneyManagementServiceServer) ModifyOrder

type UnsafeMoneyManagementServiceServer

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

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

Jump to

Keyboard shortcuts

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