Documentation ¶
Index ¶
- Variables
- func RegisterTransactionVerifierServer(s grpc.ServiceRegistrar, srv TransactionVerifierServer)
- type ITransactionVerifier
- type MockTransactionVerifier
- type StatusCode
- type Transaction
- func (*Transaction) Descriptor() ([]byte, []int)deprecated
- func (x *Transaction) GetAmount() string
- func (x *Transaction) GetStatus() string
- func (x *Transaction) GetTransactionID() int64
- func (x *Transaction) GetUserId() int64
- func (*Transaction) ProtoMessage()
- func (x *Transaction) ProtoReflect() protoreflect.Message
- func (x *Transaction) Reset()
- func (x *Transaction) String() string
- type TransactionVerifierClient
- type TransactionVerifierClientWrapper
- type TransactionVerifierImpl
- type TransactionVerifierServer
- type UnimplementedTransactionVerifierServer
- type UnsafeTransactionVerifierServer
- type VerifyTransactionRequest
- func (*VerifyTransactionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *VerifyTransactionRequest) GetTx() *Transaction
- func (*VerifyTransactionRequest) ProtoMessage()
- func (x *VerifyTransactionRequest) ProtoReflect() protoreflect.Message
- func (x *VerifyTransactionRequest) Reset()
- func (x *VerifyTransactionRequest) String() string
- type VerifyTransactionResponse
- func (*VerifyTransactionResponse) Descriptor() ([]byte, []int)deprecated
- func (x *VerifyTransactionResponse) GetCode() StatusCode
- func (x *VerifyTransactionResponse) GetMessage() string
- func (x *VerifyTransactionResponse) GetTx() *Transaction
- func (*VerifyTransactionResponse) ProtoMessage()
- func (x *VerifyTransactionResponse) ProtoReflect() protoreflect.Message
- func (x *VerifyTransactionResponse) Reset()
- func (x *VerifyTransactionResponse) String() string
Constants ¶
This section is empty.
Variables ¶
var ( StatusCode_name = map[int32]string{ 0: "OK", 1: "NOT_OK", } StatusCode_value = map[string]int32{ "OK": 0, "NOT_OK": 1, } )
Enum value maps for StatusCode.
var File_pkg_api_verifier_verifier_proto protoreflect.FileDescriptor
var TransactionVerifier_ServiceDesc = grpc.ServiceDesc{ ServiceName: "verifier.TransactionVerifier", HandlerType: (*TransactionVerifierServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "VerifyTransaction", Handler: _TransactionVerifier_VerifyTransaction_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "pkg/api/verifier/verifier.proto", }
TransactionVerifier_ServiceDesc is the grpc.ServiceDesc for TransactionVerifier service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTransactionVerifierServer ¶
func RegisterTransactionVerifierServer(s grpc.ServiceRegistrar, srv TransactionVerifierServer)
Types ¶
type ITransactionVerifier ¶
type ITransactionVerifier interface { VerifyTransaction(ctx context.Context, req *VerifyTransactionRequest) (*VerifyTransactionResponse, error) Close() }
type MockTransactionVerifier ¶
func (*MockTransactionVerifier) Close ¶
func (m *MockTransactionVerifier) Close()
func (*MockTransactionVerifier) VerifyTransaction ¶
func (m *MockTransactionVerifier) VerifyTransaction(ctx context.Context, req *VerifyTransactionRequest) (*VerifyTransactionResponse, error)
type StatusCode ¶
type StatusCode int32
const ( StatusCode_OK StatusCode = 0 StatusCode_NOT_OK StatusCode = 1 )
func (StatusCode) Descriptor ¶
func (StatusCode) Descriptor() protoreflect.EnumDescriptor
func (StatusCode) Enum ¶
func (x StatusCode) Enum() *StatusCode
func (StatusCode) EnumDescriptor
deprecated
func (StatusCode) EnumDescriptor() ([]byte, []int)
Deprecated: Use StatusCode.Descriptor instead.
func (StatusCode) Number ¶
func (x StatusCode) Number() protoreflect.EnumNumber
func (StatusCode) String ¶
func (x StatusCode) String() string
func (StatusCode) Type ¶
func (StatusCode) Type() protoreflect.EnumType
type Transaction ¶
type Transaction struct { UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` TransactionID int64 `protobuf:"varint,2,opt,name=transactionID,proto3" json:"transactionID,omitempty"` Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` Amount string `protobuf:"bytes,4,opt,name=amount,proto3" json:"amount,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() string
func (*Transaction) GetStatus ¶
func (x *Transaction) GetStatus() string
func (*Transaction) GetTransactionID ¶
func (x *Transaction) GetTransactionID() int64
func (*Transaction) GetUserId ¶
func (x *Transaction) GetUserId() 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 TransactionVerifierClient ¶
type TransactionVerifierClient interface {
VerifyTransaction(ctx context.Context, in *VerifyTransactionRequest, opts ...grpc.CallOption) (*VerifyTransactionResponse, error)
}
TransactionVerifierClient is the client API for TransactionVerifier 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 NewTransactionVerifierClient ¶
func NewTransactionVerifierClient(cc grpc.ClientConnInterface) TransactionVerifierClient
type TransactionVerifierClientWrapper ¶
type TransactionVerifierClientWrapper struct {
// contains filtered or unexported fields
}
func NewTransactionVerifierClientWrapper ¶
func NewTransactionVerifierClientWrapper(config config.ApiConfig) (*TransactionVerifierClientWrapper, error)
func (*TransactionVerifierClientWrapper) Close ¶
func (wrapper *TransactionVerifierClientWrapper) Close()
func (*TransactionVerifierClientWrapper) VerifyTransaction ¶
func (wrapper *TransactionVerifierClientWrapper) VerifyTransaction(ctx context.Context, request *VerifyTransactionRequest) (*VerifyTransactionResponse, error)
type TransactionVerifierImpl ¶
type TransactionVerifierImpl struct {
UnimplementedTransactionVerifierServer
}
func (*TransactionVerifierImpl) VerifyTransaction ¶
func (tv *TransactionVerifierImpl) VerifyTransaction(ctx context.Context, req *VerifyTransactionRequest) (*VerifyTransactionResponse, error)
type TransactionVerifierServer ¶
type TransactionVerifierServer interface { VerifyTransaction(context.Context, *VerifyTransactionRequest) (*VerifyTransactionResponse, error) // contains filtered or unexported methods }
TransactionVerifierServer is the server API for TransactionVerifier service. All implementations must embed UnimplementedTransactionVerifierServer for forward compatibility
type UnimplementedTransactionVerifierServer ¶
type UnimplementedTransactionVerifierServer struct { }
UnimplementedTransactionVerifierServer must be embedded to have forward compatible implementations.
func (UnimplementedTransactionVerifierServer) VerifyTransaction ¶
func (UnimplementedTransactionVerifierServer) VerifyTransaction(context.Context, *VerifyTransactionRequest) (*VerifyTransactionResponse, error)
type UnsafeTransactionVerifierServer ¶
type UnsafeTransactionVerifierServer interface {
// contains filtered or unexported methods
}
UnsafeTransactionVerifierServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TransactionVerifierServer will result in compilation errors.
type VerifyTransactionRequest ¶
type VerifyTransactionRequest struct { Tx *Transaction `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` // contains filtered or unexported fields }
func (*VerifyTransactionRequest) Descriptor
deprecated
func (*VerifyTransactionRequest) Descriptor() ([]byte, []int)
Deprecated: Use VerifyTransactionRequest.ProtoReflect.Descriptor instead.
func (*VerifyTransactionRequest) GetTx ¶
func (x *VerifyTransactionRequest) GetTx() *Transaction
func (*VerifyTransactionRequest) ProtoMessage ¶
func (*VerifyTransactionRequest) ProtoMessage()
func (*VerifyTransactionRequest) ProtoReflect ¶
func (x *VerifyTransactionRequest) ProtoReflect() protoreflect.Message
func (*VerifyTransactionRequest) Reset ¶
func (x *VerifyTransactionRequest) Reset()
func (*VerifyTransactionRequest) String ¶
func (x *VerifyTransactionRequest) String() string
type VerifyTransactionResponse ¶
type VerifyTransactionResponse struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` Tx *Transaction `protobuf:"bytes,2,opt,name=tx,proto3" json:"tx,omitempty"` Code StatusCode `protobuf:"varint,3,opt,name=code,proto3,enum=verifier.StatusCode" json:"code,omitempty"` // contains filtered or unexported fields }
func (*VerifyTransactionResponse) Descriptor
deprecated
func (*VerifyTransactionResponse) Descriptor() ([]byte, []int)
Deprecated: Use VerifyTransactionResponse.ProtoReflect.Descriptor instead.
func (*VerifyTransactionResponse) GetCode ¶
func (x *VerifyTransactionResponse) GetCode() StatusCode
func (*VerifyTransactionResponse) GetMessage ¶
func (x *VerifyTransactionResponse) GetMessage() string
func (*VerifyTransactionResponse) GetTx ¶
func (x *VerifyTransactionResponse) GetTx() *Transaction
func (*VerifyTransactionResponse) ProtoMessage ¶
func (*VerifyTransactionResponse) ProtoMessage()
func (*VerifyTransactionResponse) ProtoReflect ¶
func (x *VerifyTransactionResponse) ProtoReflect() protoreflect.Message
func (*VerifyTransactionResponse) Reset ¶
func (x *VerifyTransactionResponse) Reset()
func (*VerifyTransactionResponse) String ¶
func (x *VerifyTransactionResponse) String() string