Documentation ¶
Overview ¶
Package payment_v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterPaymentServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterPaymentServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PaymentServiceClient) error
- func RegisterPaymentServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterPaymentServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PaymentServiceServer) error
- func RegisterPaymentServiceServer(s grpc.ServiceRegistrar, srv PaymentServiceServer)
- type CustomerBalance
- func (*CustomerBalance) Descriptor() ([]byte, []int)deprecated
- func (x *CustomerBalance) GetBalance() float32
- func (x *CustomerBalance) GetCustomerId() string
- func (*CustomerBalance) ProtoMessage()
- func (x *CustomerBalance) ProtoReflect() protoreflect.Message
- func (x *CustomerBalance) Reset()
- func (x *CustomerBalance) String() string
- type PaymentServiceClient
- type PaymentServiceServer
- type Transaction
- func (*Transaction) Descriptor() ([]byte, []int)deprecated
- func (x *Transaction) GetAmount() float32
- func (x *Transaction) GetCustomerId() string
- func (x *Transaction) GetId() string
- func (x *Transaction) GetOrderId() string
- func (x *Transaction) GetProcessedAt() int64
- func (x *Transaction) GetReversedAt() int64
- func (*Transaction) ProtoMessage()
- func (x *Transaction) ProtoReflect() protoreflect.Message
- func (x *Transaction) Reset()
- func (x *Transaction) String() string
- type UnimplementedPaymentServiceServer
- func (UnimplementedPaymentServiceServer) ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error)
- func (UnimplementedPaymentServiceServer) ProcessUserCreatedEvent(context.Context, *v11.UserCreatedEvent) (*emptypb.Empty, error)
- func (UnimplementedPaymentServiceServer) ProcessUserDeletedEvent(context.Context, *v11.UserDeletedEvent) (*emptypb.Empty, error)
- func (UnimplementedPaymentServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
- func (UnimplementedPaymentServiceServer) ViewBalance(context.Context, *ViewBalanceRequest) (*ViewBalanceResponse, error)
- func (UnimplementedPaymentServiceServer) ViewTransaction(context.Context, *ViewTransactionRequest) (*ViewTransactionResponse, error)
- type UnsafePaymentServiceServer
- type ViewBalanceRequest
- func (*ViewBalanceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ViewBalanceRequest) GetCustomerId() string
- func (*ViewBalanceRequest) ProtoMessage()
- func (x *ViewBalanceRequest) ProtoReflect() protoreflect.Message
- func (x *ViewBalanceRequest) Reset()
- func (x *ViewBalanceRequest) String() string
- type ViewBalanceResponse
- func (*ViewBalanceResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ViewBalanceResponse) GetBalance() *CustomerBalance
- func (*ViewBalanceResponse) ProtoMessage()
- func (x *ViewBalanceResponse) ProtoReflect() protoreflect.Message
- func (x *ViewBalanceResponse) Reset()
- func (x *ViewBalanceResponse) String() string
- type ViewTransactionRequest
- func (*ViewTransactionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ViewTransactionRequest) GetTransactionId() string
- func (*ViewTransactionRequest) ProtoMessage()
- func (x *ViewTransactionRequest) ProtoReflect() protoreflect.Message
- func (x *ViewTransactionRequest) Reset()
- func (x *ViewTransactionRequest) String() string
- type ViewTransactionResponse
- func (*ViewTransactionResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ViewTransactionResponse) GetTransaction() *Transaction
- func (*ViewTransactionResponse) ProtoMessage()
- func (x *ViewTransactionResponse) ProtoReflect() protoreflect.Message
- func (x *ViewTransactionResponse) Reset()
- func (x *ViewTransactionResponse) String() string
Constants ¶
const ( PaymentService_ServiceInfo_FullMethodName = "/stocklet.payment.v1.PaymentService/ServiceInfo" PaymentService_ViewTransaction_FullMethodName = "/stocklet.payment.v1.PaymentService/ViewTransaction" PaymentService_ViewBalance_FullMethodName = "/stocklet.payment.v1.PaymentService/ViewBalance" PaymentService_ProcessUserCreatedEvent_FullMethodName = "/stocklet.payment.v1.PaymentService/ProcessUserCreatedEvent" PaymentService_ProcessUserDeletedEvent_FullMethodName = "/stocklet.payment.v1.PaymentService/ProcessUserDeletedEvent" PaymentService_ProcessShipmentAllocationEvent_FullMethodName = "/stocklet.payment.v1.PaymentService/ProcessShipmentAllocationEvent" )
Variables ¶
var File_stocklet_payment_v1_service_proto protoreflect.FileDescriptor
var File_stocklet_payment_v1_types_proto protoreflect.FileDescriptor
var PaymentService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "stocklet.payment.v1.PaymentService", HandlerType: (*PaymentServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "ServiceInfo", Handler: _PaymentService_ServiceInfo_Handler, }, { MethodName: "ViewTransaction", Handler: _PaymentService_ViewTransaction_Handler, }, { MethodName: "ViewBalance", Handler: _PaymentService_ViewBalance_Handler, }, { MethodName: "ProcessUserCreatedEvent", Handler: _PaymentService_ProcessUserCreatedEvent_Handler, }, { MethodName: "ProcessUserDeletedEvent", Handler: _PaymentService_ProcessUserDeletedEvent_Handler, }, { MethodName: "ProcessShipmentAllocationEvent", Handler: _PaymentService_ProcessShipmentAllocationEvent_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "stocklet/payment/v1/service.proto", }
PaymentService_ServiceDesc is the grpc.ServiceDesc for PaymentService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPaymentServiceHandler ¶
func RegisterPaymentServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterPaymentServiceHandler registers the http handlers for service PaymentService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterPaymentServiceHandlerClient ¶
func RegisterPaymentServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PaymentServiceClient) error
RegisterPaymentServiceHandlerClient registers the http handlers for service PaymentService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PaymentServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PaymentServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "PaymentServiceClient" to call the correct interceptors.
func RegisterPaymentServiceHandlerFromEndpoint ¶
func RegisterPaymentServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterPaymentServiceHandlerFromEndpoint is same as RegisterPaymentServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterPaymentServiceHandlerServer ¶
func RegisterPaymentServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PaymentServiceServer) error
RegisterPaymentServiceHandlerServer registers the http handlers for service PaymentService to "mux". UnaryRPC :call PaymentServiceServer 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 RegisterPaymentServiceHandlerFromEndpoint instead.
func RegisterPaymentServiceServer ¶
func RegisterPaymentServiceServer(s grpc.ServiceRegistrar, srv PaymentServiceServer)
Types ¶
type CustomerBalance ¶
type CustomerBalance struct { CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` Balance float32 `protobuf:"fixed32,2,opt,name=balance,proto3" json:"balance,omitempty"` // contains filtered or unexported fields }
func (*CustomerBalance) Descriptor
deprecated
func (*CustomerBalance) Descriptor() ([]byte, []int)
Deprecated: Use CustomerBalance.ProtoReflect.Descriptor instead.
func (*CustomerBalance) GetBalance ¶
func (x *CustomerBalance) GetBalance() float32
func (*CustomerBalance) GetCustomerId ¶
func (x *CustomerBalance) GetCustomerId() string
func (*CustomerBalance) ProtoMessage ¶
func (*CustomerBalance) ProtoMessage()
func (*CustomerBalance) ProtoReflect ¶
func (x *CustomerBalance) ProtoReflect() protoreflect.Message
func (*CustomerBalance) Reset ¶
func (x *CustomerBalance) Reset()
func (*CustomerBalance) String ¶
func (x *CustomerBalance) String() string
type PaymentServiceClient ¶
type PaymentServiceClient interface { // View information about the service. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) ViewTransaction(ctx context.Context, in *ViewTransactionRequest, opts ...grpc.CallOption) (*ViewTransactionResponse, error) ViewBalance(ctx context.Context, in *ViewBalanceRequest, opts ...grpc.CallOption) (*ViewBalanceResponse, error) // A consumer will call this method to process events. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_REQUEST_STANDARD_NAME // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME ProcessUserCreatedEvent(ctx context.Context, in *v11.UserCreatedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) // A consumer will call this method to process events. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_REQUEST_STANDARD_NAME // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME ProcessUserDeletedEvent(ctx context.Context, in *v11.UserDeletedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) // A consumer will call this method to process events. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_REQUEST_STANDARD_NAME // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME ProcessShipmentAllocationEvent(ctx context.Context, in *v11.ShipmentAllocationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) }
PaymentServiceClient is the client API for PaymentService 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 NewPaymentServiceClient ¶
func NewPaymentServiceClient(cc grpc.ClientConnInterface) PaymentServiceClient
type PaymentServiceServer ¶
type PaymentServiceServer interface { // View information about the service. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) ViewTransaction(context.Context, *ViewTransactionRequest) (*ViewTransactionResponse, error) ViewBalance(context.Context, *ViewBalanceRequest) (*ViewBalanceResponse, error) // A consumer will call this method to process events. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_REQUEST_STANDARD_NAME // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME ProcessUserCreatedEvent(context.Context, *v11.UserCreatedEvent) (*emptypb.Empty, error) // A consumer will call this method to process events. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_REQUEST_STANDARD_NAME // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME ProcessUserDeletedEvent(context.Context, *v11.UserDeletedEvent) (*emptypb.Empty, error) // A consumer will call this method to process events. // // buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE // buf:lint:ignore RPC_REQUEST_STANDARD_NAME // buf:lint:ignore RPC_RESPONSE_STANDARD_NAME ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error) // contains filtered or unexported methods }
PaymentServiceServer is the server API for PaymentService service. All implementations must embed UnimplementedPaymentServiceServer for forward compatibility
type Transaction ¶
type Transaction struct { Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Amount float32 `protobuf:"fixed32,2,opt,name=amount,proto3" json:"amount,omitempty"` OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"` CustomerId string `protobuf:"bytes,4,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` // Optional - If set, then the transaction has been refunded. ReversedAt *int64 `protobuf:"varint,5,opt,name=reversed_at,json=reversedAt,proto3,oneof" json:"reversed_at,omitempty"` ProcessedAt int64 `protobuf:"varint,6,opt,name=processed_at,json=processedAt,proto3" json:"processed_at,omitempty"` // contains filtered or unexported fields }
func (*Transaction) Descriptor
deprecated
func (*Transaction) Descriptor() ([]byte, []int)
Deprecated: Use Transaction.ProtoReflect.Descriptor instead.
func (*Transaction) GetAmount ¶
func (x *Transaction) GetAmount() float32
func (*Transaction) GetCustomerId ¶
func (x *Transaction) GetCustomerId() string
func (*Transaction) GetId ¶
func (x *Transaction) GetId() string
func (*Transaction) GetOrderId ¶
func (x *Transaction) GetOrderId() string
func (*Transaction) GetProcessedAt ¶
func (x *Transaction) GetProcessedAt() int64
func (*Transaction) GetReversedAt ¶
func (x *Transaction) GetReversedAt() int64
func (*Transaction) ProtoMessage ¶
func (*Transaction) ProtoMessage()
func (*Transaction) ProtoReflect ¶
func (x *Transaction) ProtoReflect() protoreflect.Message
func (*Transaction) Reset ¶
func (x *Transaction) Reset()
func (*Transaction) String ¶
func (x *Transaction) String() string
type UnimplementedPaymentServiceServer ¶
type UnimplementedPaymentServiceServer struct { }
UnimplementedPaymentServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedPaymentServiceServer) ProcessShipmentAllocationEvent ¶
func (UnimplementedPaymentServiceServer) ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error)
func (UnimplementedPaymentServiceServer) ProcessUserCreatedEvent ¶
func (UnimplementedPaymentServiceServer) ProcessUserCreatedEvent(context.Context, *v11.UserCreatedEvent) (*emptypb.Empty, error)
func (UnimplementedPaymentServiceServer) ProcessUserDeletedEvent ¶
func (UnimplementedPaymentServiceServer) ProcessUserDeletedEvent(context.Context, *v11.UserDeletedEvent) (*emptypb.Empty, error)
func (UnimplementedPaymentServiceServer) ServiceInfo ¶
func (UnimplementedPaymentServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
func (UnimplementedPaymentServiceServer) ViewBalance ¶
func (UnimplementedPaymentServiceServer) ViewBalance(context.Context, *ViewBalanceRequest) (*ViewBalanceResponse, error)
func (UnimplementedPaymentServiceServer) ViewTransaction ¶
func (UnimplementedPaymentServiceServer) ViewTransaction(context.Context, *ViewTransactionRequest) (*ViewTransactionResponse, error)
type UnsafePaymentServiceServer ¶
type UnsafePaymentServiceServer interface {
// contains filtered or unexported methods
}
UnsafePaymentServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PaymentServiceServer will result in compilation errors.
type ViewBalanceRequest ¶
type ViewBalanceRequest struct { CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"` // contains filtered or unexported fields }
func (*ViewBalanceRequest) Descriptor
deprecated
func (*ViewBalanceRequest) Descriptor() ([]byte, []int)
Deprecated: Use ViewBalanceRequest.ProtoReflect.Descriptor instead.
func (*ViewBalanceRequest) GetCustomerId ¶
func (x *ViewBalanceRequest) GetCustomerId() string
func (*ViewBalanceRequest) ProtoMessage ¶
func (*ViewBalanceRequest) ProtoMessage()
func (*ViewBalanceRequest) ProtoReflect ¶
func (x *ViewBalanceRequest) ProtoReflect() protoreflect.Message
func (*ViewBalanceRequest) Reset ¶
func (x *ViewBalanceRequest) Reset()
func (*ViewBalanceRequest) String ¶
func (x *ViewBalanceRequest) String() string
type ViewBalanceResponse ¶
type ViewBalanceResponse struct { Balance *CustomerBalance `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"` // contains filtered or unexported fields }
func (*ViewBalanceResponse) Descriptor
deprecated
func (*ViewBalanceResponse) Descriptor() ([]byte, []int)
Deprecated: Use ViewBalanceResponse.ProtoReflect.Descriptor instead.
func (*ViewBalanceResponse) GetBalance ¶
func (x *ViewBalanceResponse) GetBalance() *CustomerBalance
func (*ViewBalanceResponse) ProtoMessage ¶
func (*ViewBalanceResponse) ProtoMessage()
func (*ViewBalanceResponse) ProtoReflect ¶
func (x *ViewBalanceResponse) ProtoReflect() protoreflect.Message
func (*ViewBalanceResponse) Reset ¶
func (x *ViewBalanceResponse) Reset()
func (*ViewBalanceResponse) String ¶
func (x *ViewBalanceResponse) String() string
type ViewTransactionRequest ¶
type ViewTransactionRequest struct { TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` // contains filtered or unexported fields }
func (*ViewTransactionRequest) Descriptor
deprecated
func (*ViewTransactionRequest) Descriptor() ([]byte, []int)
Deprecated: Use ViewTransactionRequest.ProtoReflect.Descriptor instead.
func (*ViewTransactionRequest) GetTransactionId ¶
func (x *ViewTransactionRequest) GetTransactionId() string
func (*ViewTransactionRequest) ProtoMessage ¶
func (*ViewTransactionRequest) ProtoMessage()
func (*ViewTransactionRequest) ProtoReflect ¶
func (x *ViewTransactionRequest) ProtoReflect() protoreflect.Message
func (*ViewTransactionRequest) Reset ¶
func (x *ViewTransactionRequest) Reset()
func (*ViewTransactionRequest) String ¶
func (x *ViewTransactionRequest) String() string
type ViewTransactionResponse ¶
type ViewTransactionResponse struct { Transaction *Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"` // contains filtered or unexported fields }
func (*ViewTransactionResponse) Descriptor
deprecated
func (*ViewTransactionResponse) Descriptor() ([]byte, []int)
Deprecated: Use ViewTransactionResponse.ProtoReflect.Descriptor instead.
func (*ViewTransactionResponse) GetTransaction ¶
func (x *ViewTransactionResponse) GetTransaction() *Transaction
func (*ViewTransactionResponse) ProtoMessage ¶
func (*ViewTransactionResponse) ProtoMessage()
func (*ViewTransactionResponse) ProtoReflect ¶
func (x *ViewTransactionResponse) ProtoReflect() protoreflect.Message
func (*ViewTransactionResponse) Reset ¶
func (x *ViewTransactionResponse) Reset()
func (*ViewTransactionResponse) String ¶
func (x *ViewTransactionResponse) String() string