Documentation ¶
Overview ¶
Package srv is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterLedgerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterLedgerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LedgerServiceClient) error
- func RegisterLedgerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterLedgerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LedgerServiceServer) error
- func RegisterLedgerServiceServer(s grpc.ServiceRegistrar, srv LedgerServiceServer)
- type LedgerServiceClient
- type LedgerServiceServer
- type UnimplementedLedgerServiceServer
- func (UnimplementedLedgerServiceServer) CreateAccount(context.Context, *v1.CreateAccountRequest) (*v1.CreateAccountResponse, error)
- func (UnimplementedLedgerServiceServer) DeleteAccount(context.Context, *v1.DeleteAccountRequest) (*v1.DeleteAccountResponse, error)
- func (UnimplementedLedgerServiceServer) GetAccount(context.Context, *v1.GetAccountRequest) (*v1.GetAccountResponse, error)
- func (UnimplementedLedgerServiceServer) GetUserAccounts(context.Context, *v1.GetUserAccountsRequest) (*v1.GetUserAccountsResponse, error)
- func (UnimplementedLedgerServiceServer) HealthCheck(context.Context, *v1.HealthCheckRequest) (*v1.HealthCheckResponse, error)
- func (UnimplementedLedgerServiceServer) Transfer(context.Context, *v1.TransferRequest) (*v1.TransferResponse, error)
- func (UnimplementedLedgerServiceServer) UpdateAccount(context.Context, *v1.UpdateAccountRequest) (*v1.UpdateAccountResponse, error)
- type UnsafeLedgerServiceServer
Constants ¶
const ( LedgerService_HealthCheck_FullMethodName = "/srvpb.v1.LedgerService/HealthCheck" LedgerService_CreateAccount_FullMethodName = "/srvpb.v1.LedgerService/CreateAccount" LedgerService_UpdateAccount_FullMethodName = "/srvpb.v1.LedgerService/UpdateAccount" LedgerService_DeleteAccount_FullMethodName = "/srvpb.v1.LedgerService/DeleteAccount" LedgerService_GetAccount_FullMethodName = "/srvpb.v1.LedgerService/GetAccount" LedgerService_GetUserAccounts_FullMethodName = "/srvpb.v1.LedgerService/GetUserAccounts" LedgerService_Transfer_FullMethodName = "/srvpb.v1.LedgerService/Transfer" )
Variables ¶
var File_srvpb_v1_oracle_proto protoreflect.FileDescriptor
var LedgerService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "srvpb.v1.LedgerService", HandlerType: (*LedgerServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "HealthCheck", Handler: _LedgerService_HealthCheck_Handler, }, { MethodName: "CreateAccount", Handler: _LedgerService_CreateAccount_Handler, }, { MethodName: "UpdateAccount", Handler: _LedgerService_UpdateAccount_Handler, }, { MethodName: "DeleteAccount", Handler: _LedgerService_DeleteAccount_Handler, }, { MethodName: "GetAccount", Handler: _LedgerService_GetAccount_Handler, }, { MethodName: "GetUserAccounts", Handler: _LedgerService_GetUserAccounts_Handler, }, { MethodName: "Transfer", Handler: _LedgerService_Transfer_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "srvpb/v1/oracle.proto", }
LedgerService_ServiceDesc is the grpc.ServiceDesc for LedgerService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterLedgerServiceHandler ¶
func RegisterLedgerServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterLedgerServiceHandler registers the http handlers for service LedgerService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterLedgerServiceHandlerClient ¶
func RegisterLedgerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LedgerServiceClient) error
RegisterLedgerServiceHandlerClient registers the http handlers for service LedgerService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "LedgerServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "LedgerServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "LedgerServiceClient" to call the correct interceptors.
func RegisterLedgerServiceHandlerFromEndpoint ¶
func RegisterLedgerServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterLedgerServiceHandlerFromEndpoint is same as RegisterLedgerServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterLedgerServiceHandlerServer ¶
func RegisterLedgerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LedgerServiceServer) error
RegisterLedgerServiceHandlerServer registers the http handlers for service LedgerService to "mux". UnaryRPC :call LedgerServiceServer 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 RegisterLedgerServiceHandlerFromEndpoint instead.
func RegisterLedgerServiceServer ¶
func RegisterLedgerServiceServer(s grpc.ServiceRegistrar, srv LedgerServiceServer)
Types ¶
type LedgerServiceClient ¶
type LedgerServiceClient interface { // Check the health of the service. This is used by load balancers to check service health. HealthCheck(ctx context.Context, in *v1.HealthCheckRequest, opts ...grpc.CallOption) (*v1.HealthCheckResponse, error) // Create a new account denominated in an underlying asset. CreateAccount(ctx context.Context, in *v1.CreateAccountRequest, opts ...grpc.CallOption) (*v1.CreateAccountResponse, error) // Update an account. UpdateAccount(ctx context.Context, in *v1.UpdateAccountRequest, opts ...grpc.CallOption) (*v1.UpdateAccountResponse, error) // Delete an account. DeleteAccount(ctx context.Context, in *v1.DeleteAccountRequest, opts ...grpc.CallOption) (*v1.DeleteAccountResponse, error) // Retrieve account details. GetAccount(ctx context.Context, in *v1.GetAccountRequest, opts ...grpc.CallOption) (*v1.GetAccountResponse, error) // Get accounts for a user. GetUserAccounts(ctx context.Context, in *v1.GetUserAccountsRequest, opts ...grpc.CallOption) (*v1.GetUserAccountsResponse, error) // Transfer between accounts denominated in the same underlying asset. Transfer(ctx context.Context, in *v1.TransferRequest, opts ...grpc.CallOption) (*v1.TransferResponse, error) }
LedgerServiceClient is the client API for LedgerService 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.
func NewLedgerServiceClient ¶
func NewLedgerServiceClient(cc grpc.ClientConnInterface) LedgerServiceClient
type LedgerServiceServer ¶
type LedgerServiceServer interface { // Check the health of the service. This is used by load balancers to check service health. HealthCheck(context.Context, *v1.HealthCheckRequest) (*v1.HealthCheckResponse, error) // Create a new account denominated in an underlying asset. CreateAccount(context.Context, *v1.CreateAccountRequest) (*v1.CreateAccountResponse, error) // Update an account. UpdateAccount(context.Context, *v1.UpdateAccountRequest) (*v1.UpdateAccountResponse, error) // Delete an account. DeleteAccount(context.Context, *v1.DeleteAccountRequest) (*v1.DeleteAccountResponse, error) // Retrieve account details. GetAccount(context.Context, *v1.GetAccountRequest) (*v1.GetAccountResponse, error) // Get accounts for a user. GetUserAccounts(context.Context, *v1.GetUserAccountsRequest) (*v1.GetUserAccountsResponse, error) // Transfer between accounts denominated in the same underlying asset. Transfer(context.Context, *v1.TransferRequest) (*v1.TransferResponse, error) // contains filtered or unexported methods }
LedgerServiceServer is the server API for LedgerService service. All implementations must embed UnimplementedLedgerServiceServer for forward compatibility
type UnimplementedLedgerServiceServer ¶
type UnimplementedLedgerServiceServer struct { }
UnimplementedLedgerServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedLedgerServiceServer) CreateAccount ¶
func (UnimplementedLedgerServiceServer) CreateAccount(context.Context, *v1.CreateAccountRequest) (*v1.CreateAccountResponse, error)
func (UnimplementedLedgerServiceServer) DeleteAccount ¶
func (UnimplementedLedgerServiceServer) DeleteAccount(context.Context, *v1.DeleteAccountRequest) (*v1.DeleteAccountResponse, error)
func (UnimplementedLedgerServiceServer) GetAccount ¶
func (UnimplementedLedgerServiceServer) GetAccount(context.Context, *v1.GetAccountRequest) (*v1.GetAccountResponse, error)
func (UnimplementedLedgerServiceServer) GetUserAccounts ¶
func (UnimplementedLedgerServiceServer) GetUserAccounts(context.Context, *v1.GetUserAccountsRequest) (*v1.GetUserAccountsResponse, error)
func (UnimplementedLedgerServiceServer) HealthCheck ¶
func (UnimplementedLedgerServiceServer) HealthCheck(context.Context, *v1.HealthCheckRequest) (*v1.HealthCheckResponse, error)
func (UnimplementedLedgerServiceServer) Transfer ¶
func (UnimplementedLedgerServiceServer) Transfer(context.Context, *v1.TransferRequest) (*v1.TransferResponse, error)
func (UnimplementedLedgerServiceServer) UpdateAccount ¶
func (UnimplementedLedgerServiceServer) UpdateAccount(context.Context, *v1.UpdateAccountRequest) (*v1.UpdateAccountResponse, error)
type UnsafeLedgerServiceServer ¶
type UnsafeLedgerServiceServer interface {
// contains filtered or unexported methods
}
UnsafeLedgerServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LedgerServiceServer will result in compilation errors.