verifier

package
v0.0.0-...-2a1576b Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
var File_pkg_api_verifier_verifier_proto protoreflect.FileDescriptor
View Source
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

type MockTransactionVerifier struct {
	mock.Mock
}

func (*MockTransactionVerifier) Close

func (m *MockTransactionVerifier) Close()

func (*MockTransactionVerifier) VerifyTransaction

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

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.

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

type TransactionVerifierImpl

type TransactionVerifierImpl struct {
	UnimplementedTransactionVerifierServer
}

func (*TransactionVerifierImpl) VerifyTransaction

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

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 (*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 (*VerifyTransactionResponse) GetMessage

func (x *VerifyTransactionResponse) GetMessage() string

func (*VerifyTransactionResponse) GetTx

func (*VerifyTransactionResponse) ProtoMessage

func (*VerifyTransactionResponse) ProtoMessage()

func (*VerifyTransactionResponse) ProtoReflect

func (*VerifyTransactionResponse) Reset

func (x *VerifyTransactionResponse) Reset()

func (*VerifyTransactionResponse) String

func (x *VerifyTransactionResponse) String() string

Jump to

Keyboard shortcuts

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