router

package
v0.0.0-...-d047bce Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package router is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_services_router_pb_v1_router_proto protoreflect.FileDescriptor

Functions

func RegisterRouterServiceHandler

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

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

func RegisterRouterServiceHandlerClient

func RegisterRouterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RouterServiceClient) error

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

func RegisterRouterServiceHandlerFromEndpoint

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

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

func RegisterRouterServiceHandlerServer

func RegisterRouterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RouterServiceServer) error

RegisterRouterServiceHandlerServer registers the http handlers for service RouterService to "mux". UnaryRPC :call RouterServiceServer 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 RegisterRouterServiceHandlerFromEndpoint instead.

func RegisterRouterServiceServer

func RegisterRouterServiceServer(s grpc.ServiceRegistrar, srv RouterServiceServer)

Types

type AddTransactionRequest

type AddTransactionRequest struct {
	Token      string    `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	UserId     string    `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Asset      *v1.Asset `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"`
	Quantity   float64   `protobuf:"fixed64,4,opt,name=quantity,proto3" json:"quantity,omitempty"`
	Price      float64   `protobuf:"fixed64,5,opt,name=price,proto3" json:"price,omitempty"` //  in US Dollar
	ExecutedAt int64     `protobuf:"varint,6,opt,name=executed_at,json=executedAt,proto3" json:"executed_at,omitempty"`
	// contains filtered or unexported fields
}

func (*AddTransactionRequest) Descriptor deprecated

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

Deprecated: Use AddTransactionRequest.ProtoReflect.Descriptor instead.

func (*AddTransactionRequest) GetAsset

func (x *AddTransactionRequest) GetAsset() *v1.Asset

func (*AddTransactionRequest) GetExecutedAt

func (x *AddTransactionRequest) GetExecutedAt() int64

func (*AddTransactionRequest) GetPrice

func (x *AddTransactionRequest) GetPrice() float64

func (*AddTransactionRequest) GetQuantity

func (x *AddTransactionRequest) GetQuantity() float64

func (*AddTransactionRequest) GetToken

func (x *AddTransactionRequest) GetToken() string

func (*AddTransactionRequest) GetUserId

func (x *AddTransactionRequest) GetUserId() string

func (*AddTransactionRequest) ProtoMessage

func (*AddTransactionRequest) ProtoMessage()

func (*AddTransactionRequest) ProtoReflect

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

func (*AddTransactionRequest) Reset

func (x *AddTransactionRequest) Reset()

func (*AddTransactionRequest) String

func (x *AddTransactionRequest) String() string

type AddTransactionResponse

type AddTransactionResponse struct {
	TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"`
	// contains filtered or unexported fields
}

func (*AddTransactionResponse) Descriptor deprecated

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

Deprecated: Use AddTransactionResponse.ProtoReflect.Descriptor instead.

func (*AddTransactionResponse) GetTransactionId

func (x *AddTransactionResponse) GetTransactionId() string

func (*AddTransactionResponse) ProtoMessage

func (*AddTransactionResponse) ProtoMessage()

func (*AddTransactionResponse) ProtoReflect

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

func (*AddTransactionResponse) Reset

func (x *AddTransactionResponse) Reset()

func (*AddTransactionResponse) String

func (x *AddTransactionResponse) String() string

type FactorRequest

type FactorRequest struct {
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	Path  string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	// contains filtered or unexported fields
}

func (*FactorRequest) Descriptor deprecated

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

Deprecated: Use FactorRequest.ProtoReflect.Descriptor instead.

func (*FactorRequest) GetPath

func (x *FactorRequest) GetPath() string

func (*FactorRequest) GetToken

func (x *FactorRequest) GetToken() string

func (*FactorRequest) ProtoMessage

func (*FactorRequest) ProtoMessage()

func (*FactorRequest) ProtoReflect

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

func (*FactorRequest) Reset

func (x *FactorRequest) Reset()

func (*FactorRequest) String

func (x *FactorRequest) String() string

type FactorResponse

type FactorResponse struct {
	Factor string `protobuf:"bytes,1,opt,name=factor,proto3" json:"factor,omitempty"`
	// contains filtered or unexported fields
}

func (*FactorResponse) Descriptor deprecated

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

Deprecated: Use FactorResponse.ProtoReflect.Descriptor instead.

func (*FactorResponse) GetFactor

func (x *FactorResponse) GetFactor() string

func (*FactorResponse) ProtoMessage

func (*FactorResponse) ProtoMessage()

func (*FactorResponse) ProtoReflect

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

func (*FactorResponse) Reset

func (x *FactorResponse) Reset()

func (*FactorResponse) String

func (x *FactorResponse) String() string

type GetPortfolioHistoryRequest

type GetPortfolioHistoryRequest struct {
	Token  string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPortfolioHistoryRequest) Descriptor deprecated

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

Deprecated: Use GetPortfolioHistoryRequest.ProtoReflect.Descriptor instead.

func (*GetPortfolioHistoryRequest) GetToken

func (x *GetPortfolioHistoryRequest) GetToken() string

func (*GetPortfolioHistoryRequest) GetUserId

func (x *GetPortfolioHistoryRequest) GetUserId() string

func (*GetPortfolioHistoryRequest) ProtoMessage

func (*GetPortfolioHistoryRequest) ProtoMessage()

func (*GetPortfolioHistoryRequest) ProtoReflect

func (*GetPortfolioHistoryRequest) Reset

func (x *GetPortfolioHistoryRequest) Reset()

func (*GetPortfolioHistoryRequest) String

func (x *GetPortfolioHistoryRequest) String() string

type GetPortfolioHistoryResponse

type GetPortfolioHistoryResponse struct {
	Holdings []*v1.HoldingHistory `protobuf:"bytes,1,rep,name=holdings,proto3" json:"holdings,omitempty"`
	// contains filtered or unexported fields
}

func (*GetPortfolioHistoryResponse) Descriptor deprecated

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

Deprecated: Use GetPortfolioHistoryResponse.ProtoReflect.Descriptor instead.

func (*GetPortfolioHistoryResponse) GetHoldings

func (x *GetPortfolioHistoryResponse) GetHoldings() []*v1.HoldingHistory

func (*GetPortfolioHistoryResponse) ProtoMessage

func (*GetPortfolioHistoryResponse) ProtoMessage()

func (*GetPortfolioHistoryResponse) ProtoReflect

func (*GetPortfolioHistoryResponse) Reset

func (x *GetPortfolioHistoryResponse) Reset()

func (*GetPortfolioHistoryResponse) String

func (x *GetPortfolioHistoryResponse) String() string

type RouterServiceClient

type RouterServiceClient interface {
	// Request Factor from FactorAPI.
	Factor(ctx context.Context, in *FactorRequest, opts ...grpc.CallOption) (*FactorResponse, error)
	// Request AddTransaction from VaultService.
	AddTransaction(ctx context.Context, in *AddTransactionRequest, opts ...grpc.CallOption) (*AddTransactionResponse, error)
	// GetPortfolioHistory returns all holdings for each interval.
	GetPortfolioHistory(ctx context.Context, in *GetPortfolioHistoryRequest, opts ...grpc.CallOption) (*GetPortfolioHistoryResponse, error)
}

RouterServiceClient is the client API for RouterService 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 RouterServiceServer

type RouterServiceServer interface {
	// Request Factor from FactorAPI.
	Factor(context.Context, *FactorRequest) (*FactorResponse, error)
	// Request AddTransaction from VaultService.
	AddTransaction(context.Context, *AddTransactionRequest) (*AddTransactionResponse, error)
	// GetPortfolioHistory returns all holdings for each interval.
	GetPortfolioHistory(context.Context, *GetPortfolioHistoryRequest) (*GetPortfolioHistoryResponse, error)
	// contains filtered or unexported methods
}

RouterServiceServer is the server API for RouterService service. All implementations must embed UnimplementedRouterServiceServer for forward compatibility

type UnimplementedRouterServiceServer

type UnimplementedRouterServiceServer struct {
}

UnimplementedRouterServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedRouterServiceServer) AddTransaction

func (UnimplementedRouterServiceServer) Factor

type UnsafeRouterServiceServer

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

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

Jump to

Keyboard shortcuts

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