v1

package
v0.0.0-...-701c789 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var BalanceService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pkg.pbs.balance.v1.BalanceService",
	HandlerType: (*BalanceServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListBalances",
			Handler:    _BalanceService_ListBalances_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pkg/pbs/balance/v1/balance.proto",
}

BalanceService_ServiceDesc is the grpc.ServiceDesc for BalanceService 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_pkg_pbs_balance_v1_balance_proto protoreflect.FileDescriptor

Functions

func RegisterBalanceServiceHandler

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

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

func RegisterBalanceServiceHandlerClient

func RegisterBalanceServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BalanceServiceClient) error

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

func RegisterBalanceServiceHandlerFromEndpoint

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

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

func RegisterBalanceServiceHandlerServer

func RegisterBalanceServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BalanceServiceServer) error

RegisterBalanceServiceHandlerServer registers the http handlers for service BalanceService to "mux". UnaryRPC :call BalanceServiceServer 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 RegisterBalanceServiceHandlerFromEndpoint instead.

func RegisterBalanceServiceServer

func RegisterBalanceServiceServer(s grpc.ServiceRegistrar, srv BalanceServiceServer)

Types

type AccountAndBalance

type AccountAndBalance struct {
	UserId    string                 `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"`
	Currency  string                 `protobuf:"bytes,2,opt,name=currency,proto3" json:"currency,omitempty"`
	Balance   string                 `protobuf:"bytes,3,opt,name=balance,proto3" json:"balance,omitempty"`
	Hold      string                 `protobuf:"bytes,4,opt,name=hold,proto3" json:"hold,omitempty"`
	Available string                 `protobuf:"bytes,5,opt,name=available,proto3" json:"available,omitempty"`
	BalanceAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=balanceAt,proto3" json:"balanceAt,omitempty"`
	FiatValue string                 `protobuf:"bytes,7,opt,name=fiatValue,proto3" json:"fiatValue,omitempty"`
	// contains filtered or unexported fields
}

func (*AccountAndBalance) Descriptor deprecated

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

Deprecated: Use AccountAndBalance.ProtoReflect.Descriptor instead.

func (*AccountAndBalance) GetAvailable

func (x *AccountAndBalance) GetAvailable() string

func (*AccountAndBalance) GetBalance

func (x *AccountAndBalance) GetBalance() string

func (*AccountAndBalance) GetBalanceAt

func (x *AccountAndBalance) GetBalanceAt() *timestamppb.Timestamp

func (*AccountAndBalance) GetCurrency

func (x *AccountAndBalance) GetCurrency() string

func (*AccountAndBalance) GetFiatValue

func (x *AccountAndBalance) GetFiatValue() string

func (*AccountAndBalance) GetHold

func (x *AccountAndBalance) GetHold() string

func (*AccountAndBalance) GetUserId

func (x *AccountAndBalance) GetUserId() string

func (*AccountAndBalance) ProtoMessage

func (*AccountAndBalance) ProtoMessage()

func (*AccountAndBalance) ProtoReflect

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

func (*AccountAndBalance) Reset

func (x *AccountAndBalance) Reset()

func (*AccountAndBalance) String

func (x *AccountAndBalance) String() string

func (*AccountAndBalance) Validate

func (m *AccountAndBalance) Validate() error

Validate checks the field values on AccountAndBalance with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*AccountAndBalance) ValidateAll

func (m *AccountAndBalance) ValidateAll() error

ValidateAll checks the field values on AccountAndBalance with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in AccountAndBalanceMultiError, or nil if none found.

type AccountAndBalanceMultiError

type AccountAndBalanceMultiError []error

AccountAndBalanceMultiError is an error wrapping multiple validation errors returned by AccountAndBalance.ValidateAll() if the designated constraints aren't met.

func (AccountAndBalanceMultiError) AllErrors

func (m AccountAndBalanceMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (AccountAndBalanceMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type AccountAndBalanceValidationError

type AccountAndBalanceValidationError struct {
	// contains filtered or unexported fields
}

AccountAndBalanceValidationError is the validation error returned by AccountAndBalance.Validate if the designated constraints aren't met.

func (AccountAndBalanceValidationError) Cause

Cause function returns cause value.

func (AccountAndBalanceValidationError) Error

Error satisfies the builtin error interface

func (AccountAndBalanceValidationError) ErrorName

ErrorName returns error name.

func (AccountAndBalanceValidationError) Field

Field function returns field value.

func (AccountAndBalanceValidationError) Key

Key function returns key value.

func (AccountAndBalanceValidationError) Reason

Reason function returns reason value.

type BalanceServiceClient

type BalanceServiceClient interface {
	ListBalances(ctx context.Context, in *ListBalancesRequest, opts ...grpc.CallOption) (*ListBalancesResponse, error)
}

BalanceServiceClient is the client API for BalanceService 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 BalanceServiceServer

type BalanceServiceServer interface {
	ListBalances(context.Context, *ListBalancesRequest) (*ListBalancesResponse, error)
	// contains filtered or unexported methods
}

BalanceServiceServer is the server API for BalanceService service. All implementations must embed UnimplementedBalanceServiceServer for forward compatibility

type ListBalancesRequest

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

func (*ListBalancesRequest) Descriptor deprecated

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

Deprecated: Use ListBalancesRequest.ProtoReflect.Descriptor instead.

func (*ListBalancesRequest) GetId

func (x *ListBalancesRequest) GetId() string

func (*ListBalancesRequest) ProtoMessage

func (*ListBalancesRequest) ProtoMessage()

func (*ListBalancesRequest) ProtoReflect

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

func (*ListBalancesRequest) Reset

func (x *ListBalancesRequest) Reset()

func (*ListBalancesRequest) String

func (x *ListBalancesRequest) String() string

func (*ListBalancesRequest) Validate

func (m *ListBalancesRequest) Validate() error

Validate checks the field values on ListBalancesRequest with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ListBalancesRequest) ValidateAll

func (m *ListBalancesRequest) ValidateAll() error

ValidateAll checks the field values on ListBalancesRequest with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ListBalancesRequestMultiError, or nil if none found.

type ListBalancesRequestMultiError

type ListBalancesRequestMultiError []error

ListBalancesRequestMultiError is an error wrapping multiple validation errors returned by ListBalancesRequest.ValidateAll() if the designated constraints aren't met.

func (ListBalancesRequestMultiError) AllErrors

func (m ListBalancesRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListBalancesRequestMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type ListBalancesRequestValidationError

type ListBalancesRequestValidationError struct {
	// contains filtered or unexported fields
}

ListBalancesRequestValidationError is the validation error returned by ListBalancesRequest.Validate if the designated constraints aren't met.

func (ListBalancesRequestValidationError) Cause

Cause function returns cause value.

func (ListBalancesRequestValidationError) Error

Error satisfies the builtin error interface

func (ListBalancesRequestValidationError) ErrorName

ErrorName returns error name.

func (ListBalancesRequestValidationError) Field

Field function returns field value.

func (ListBalancesRequestValidationError) Key

Key function returns key value.

func (ListBalancesRequestValidationError) Reason

Reason function returns reason value.

type ListBalancesResponse

type ListBalancesResponse struct {
	Data []*AccountAndBalance `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*ListBalancesResponse) Descriptor deprecated

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

Deprecated: Use ListBalancesResponse.ProtoReflect.Descriptor instead.

func (*ListBalancesResponse) GetData

func (x *ListBalancesResponse) GetData() []*AccountAndBalance

func (*ListBalancesResponse) ProtoMessage

func (*ListBalancesResponse) ProtoMessage()

func (*ListBalancesResponse) ProtoReflect

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

func (*ListBalancesResponse) Reset

func (x *ListBalancesResponse) Reset()

func (*ListBalancesResponse) String

func (x *ListBalancesResponse) String() string

func (*ListBalancesResponse) Validate

func (m *ListBalancesResponse) Validate() error

Validate checks the field values on ListBalancesResponse with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*ListBalancesResponse) ValidateAll

func (m *ListBalancesResponse) ValidateAll() error

ValidateAll checks the field values on ListBalancesResponse with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ListBalancesResponseMultiError, or nil if none found.

type ListBalancesResponseMultiError

type ListBalancesResponseMultiError []error

ListBalancesResponseMultiError is an error wrapping multiple validation errors returned by ListBalancesResponse.ValidateAll() if the designated constraints aren't met.

func (ListBalancesResponseMultiError) AllErrors

func (m ListBalancesResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (ListBalancesResponseMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type ListBalancesResponseValidationError

type ListBalancesResponseValidationError struct {
	// contains filtered or unexported fields
}

ListBalancesResponseValidationError is the validation error returned by ListBalancesResponse.Validate if the designated constraints aren't met.

func (ListBalancesResponseValidationError) Cause

Cause function returns cause value.

func (ListBalancesResponseValidationError) Error

Error satisfies the builtin error interface

func (ListBalancesResponseValidationError) ErrorName

ErrorName returns error name.

func (ListBalancesResponseValidationError) Field

Field function returns field value.

func (ListBalancesResponseValidationError) Key

Key function returns key value.

func (ListBalancesResponseValidationError) Reason

Reason function returns reason value.

type UnimplementedBalanceServiceServer

type UnimplementedBalanceServiceServer struct {
}

UnimplementedBalanceServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedBalanceServiceServer) ListBalances

type UnsafeBalanceServiceServer

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

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

Jump to

Keyboard shortcuts

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