v1

package
v0.0.0-...-c435387 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_api_transfer_v1_transfer_proto protoreflect.FileDescriptor
View Source
var Transfer_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.transfer.v1.transfer",
	HandlerType: (*TransferServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Transfer",
			Handler:    _Transfer_Transfer_Handler,
		},
		{
			MethodName: "TransOut",
			Handler:    _Transfer_TransOut_Handler,
		},
		{
			MethodName: "TransIn",
			Handler:    _Transfer_TransIn_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/transfer/v1/transfer.proto",
}

Transfer_ServiceDesc is the grpc.ServiceDesc for Transfer service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterTransferServer

func RegisterTransferServer(s grpc.ServiceRegistrar, srv TransferServer)

Types

type TransInReply

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

func (*TransInReply) Descriptor deprecated

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

Deprecated: Use TransInReply.ProtoReflect.Descriptor instead.

func (*TransInReply) ProtoMessage

func (*TransInReply) ProtoMessage()

func (*TransInReply) ProtoReflect

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

func (*TransInReply) Reset

func (x *TransInReply) Reset()

func (*TransInReply) String

func (x *TransInReply) String() string

func (*TransInReply) Validate

func (m *TransInReply) Validate() error

Validate checks the field values on TransInReply 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 (*TransInReply) ValidateAll

func (m *TransInReply) ValidateAll() error

ValidateAll checks the field values on TransInReply 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 TransInReplyMultiError, or nil if none found.

type TransInReplyMultiError

type TransInReplyMultiError []error

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

func (TransInReplyMultiError) AllErrors

func (m TransInReplyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TransInReplyMultiError) Error

func (m TransInReplyMultiError) Error() string

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

type TransInReplyValidationError

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

TransInReplyValidationError is the validation error returned by TransInReply.Validate if the designated constraints aren't met.

func (TransInReplyValidationError) Cause

Cause function returns cause value.

func (TransInReplyValidationError) Error

Error satisfies the builtin error interface

func (TransInReplyValidationError) ErrorName

func (e TransInReplyValidationError) ErrorName() string

ErrorName returns error name.

func (TransInReplyValidationError) Field

Field function returns field value.

func (TransInReplyValidationError) Key

Key function returns key value.

func (TransInReplyValidationError) Reason

Reason function returns reason value.

type TransInRequest

type TransInRequest struct {
	Amount uint32 `protobuf:"varint,1,opt,name=Amount,proto3" json:"Amount"`
	UserId uint64 `protobuf:"varint,2,opt,name=UserId,proto3" json:"UserId"`
	// contains filtered or unexported fields
}

func (*TransInRequest) Descriptor deprecated

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

Deprecated: Use TransInRequest.ProtoReflect.Descriptor instead.

func (*TransInRequest) GetAmount

func (x *TransInRequest) GetAmount() uint32

func (*TransInRequest) GetUserId

func (x *TransInRequest) GetUserId() uint64

func (*TransInRequest) ProtoMessage

func (*TransInRequest) ProtoMessage()

func (*TransInRequest) ProtoReflect

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

func (*TransInRequest) Reset

func (x *TransInRequest) Reset()

func (*TransInRequest) String

func (x *TransInRequest) String() string

func (*TransInRequest) Validate

func (m *TransInRequest) Validate() error

Validate checks the field values on TransInRequest 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 (*TransInRequest) ValidateAll

func (m *TransInRequest) ValidateAll() error

ValidateAll checks the field values on TransInRequest 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 TransInRequestMultiError, or nil if none found.

type TransInRequestMultiError

type TransInRequestMultiError []error

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

func (TransInRequestMultiError) AllErrors

func (m TransInRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TransInRequestMultiError) Error

func (m TransInRequestMultiError) Error() string

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

type TransInRequestValidationError

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

TransInRequestValidationError is the validation error returned by TransInRequest.Validate if the designated constraints aren't met.

func (TransInRequestValidationError) Cause

Cause function returns cause value.

func (TransInRequestValidationError) Error

Error satisfies the builtin error interface

func (TransInRequestValidationError) ErrorName

func (e TransInRequestValidationError) ErrorName() string

ErrorName returns error name.

func (TransInRequestValidationError) Field

Field function returns field value.

func (TransInRequestValidationError) Key

Key function returns key value.

func (TransInRequestValidationError) Reason

Reason function returns reason value.

type TransOutReply

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

func (*TransOutReply) Descriptor deprecated

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

Deprecated: Use TransOutReply.ProtoReflect.Descriptor instead.

func (*TransOutReply) ProtoMessage

func (*TransOutReply) ProtoMessage()

func (*TransOutReply) ProtoReflect

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

func (*TransOutReply) Reset

func (x *TransOutReply) Reset()

func (*TransOutReply) String

func (x *TransOutReply) String() string

func (*TransOutReply) Validate

func (m *TransOutReply) Validate() error

Validate checks the field values on TransOutReply 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 (*TransOutReply) ValidateAll

func (m *TransOutReply) ValidateAll() error

ValidateAll checks the field values on TransOutReply 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 TransOutReplyMultiError, or nil if none found.

type TransOutReplyMultiError

type TransOutReplyMultiError []error

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

func (TransOutReplyMultiError) AllErrors

func (m TransOutReplyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TransOutReplyMultiError) Error

func (m TransOutReplyMultiError) Error() string

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

type TransOutReplyValidationError

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

TransOutReplyValidationError is the validation error returned by TransOutReply.Validate if the designated constraints aren't met.

func (TransOutReplyValidationError) Cause

Cause function returns cause value.

func (TransOutReplyValidationError) Error

Error satisfies the builtin error interface

func (TransOutReplyValidationError) ErrorName

func (e TransOutReplyValidationError) ErrorName() string

ErrorName returns error name.

func (TransOutReplyValidationError) Field

Field function returns field value.

func (TransOutReplyValidationError) Key

Key function returns key value.

func (TransOutReplyValidationError) Reason

Reason function returns reason value.

type TransOutRequest

type TransOutRequest struct {
	Amount uint32 `protobuf:"varint,1,opt,name=Amount,proto3" json:"Amount"`
	UserId uint64 `protobuf:"varint,2,opt,name=UserId,proto3" json:"UserId"`
	// contains filtered or unexported fields
}

func (*TransOutRequest) Descriptor deprecated

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

Deprecated: Use TransOutRequest.ProtoReflect.Descriptor instead.

func (*TransOutRequest) GetAmount

func (x *TransOutRequest) GetAmount() uint32

func (*TransOutRequest) GetUserId

func (x *TransOutRequest) GetUserId() uint64

func (*TransOutRequest) ProtoMessage

func (*TransOutRequest) ProtoMessage()

func (*TransOutRequest) ProtoReflect

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

func (*TransOutRequest) Reset

func (x *TransOutRequest) Reset()

func (*TransOutRequest) String

func (x *TransOutRequest) String() string

func (*TransOutRequest) Validate

func (m *TransOutRequest) Validate() error

Validate checks the field values on TransOutRequest 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 (*TransOutRequest) ValidateAll

func (m *TransOutRequest) ValidateAll() error

ValidateAll checks the field values on TransOutRequest 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 TransOutRequestMultiError, or nil if none found.

type TransOutRequestMultiError

type TransOutRequestMultiError []error

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

func (TransOutRequestMultiError) AllErrors

func (m TransOutRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TransOutRequestMultiError) Error

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

type TransOutRequestValidationError

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

TransOutRequestValidationError is the validation error returned by TransOutRequest.Validate if the designated constraints aren't met.

func (TransOutRequestValidationError) Cause

Cause function returns cause value.

func (TransOutRequestValidationError) Error

Error satisfies the builtin error interface

func (TransOutRequestValidationError) ErrorName

func (e TransOutRequestValidationError) ErrorName() string

ErrorName returns error name.

func (TransOutRequestValidationError) Field

Field function returns field value.

func (TransOutRequestValidationError) Key

Key function returns key value.

func (TransOutRequestValidationError) Reason

Reason function returns reason value.

type TransferClient

type TransferClient interface {
	// 转账
	Transfer(ctx context.Context, in *TransferRequest, opts ...grpc.CallOption) (*TransferReply, error)
	// 转出
	TransOut(ctx context.Context, in *TransOutRequest, opts ...grpc.CallOption) (*TransOutReply, error)
	// 转入
	TransIn(ctx context.Context, in *TransInRequest, opts ...grpc.CallOption) (*TransInReply, error)
}

TransferClient is the client API for Transfer 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 NewTransferClient

func NewTransferClient(cc grpc.ClientConnInterface) TransferClient

type TransferReply

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

func (*TransferReply) Descriptor deprecated

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

Deprecated: Use TransferReply.ProtoReflect.Descriptor instead.

func (*TransferReply) ProtoMessage

func (*TransferReply) ProtoMessage()

func (*TransferReply) ProtoReflect

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

func (*TransferReply) Reset

func (x *TransferReply) Reset()

func (*TransferReply) String

func (x *TransferReply) String() string

func (*TransferReply) Validate

func (m *TransferReply) Validate() error

Validate checks the field values on TransferReply 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 (*TransferReply) ValidateAll

func (m *TransferReply) ValidateAll() error

ValidateAll checks the field values on TransferReply 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 TransferReplyMultiError, or nil if none found.

type TransferReplyMultiError

type TransferReplyMultiError []error

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

func (TransferReplyMultiError) AllErrors

func (m TransferReplyMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TransferReplyMultiError) Error

func (m TransferReplyMultiError) Error() string

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

type TransferReplyValidationError

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

TransferReplyValidationError is the validation error returned by TransferReply.Validate if the designated constraints aren't met.

func (TransferReplyValidationError) Cause

Cause function returns cause value.

func (TransferReplyValidationError) Error

Error satisfies the builtin error interface

func (TransferReplyValidationError) ErrorName

func (e TransferReplyValidationError) ErrorName() string

ErrorName returns error name.

func (TransferReplyValidationError) Field

Field function returns field value.

func (TransferReplyValidationError) Key

Key function returns key value.

func (TransferReplyValidationError) Reason

Reason function returns reason value.

type TransferRequest

type TransferRequest struct {
	Amount     uint32 `protobuf:"varint,1,opt,name=Amount,proto3" json:"Amount"`
	FromUserId uint64 `protobuf:"varint,2,opt,name=FromUserId,proto3" json:"FromUserId"`
	ToUserId   uint64 `protobuf:"varint,3,opt,name=ToUserId,proto3" json:"ToUserId"`
	// contains filtered or unexported fields
}

func (*TransferRequest) Descriptor deprecated

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

Deprecated: Use TransferRequest.ProtoReflect.Descriptor instead.

func (*TransferRequest) GetAmount

func (x *TransferRequest) GetAmount() uint32

func (*TransferRequest) GetFromUserId

func (x *TransferRequest) GetFromUserId() uint64

func (*TransferRequest) GetToUserId

func (x *TransferRequest) GetToUserId() uint64

func (*TransferRequest) ProtoMessage

func (*TransferRequest) ProtoMessage()

func (*TransferRequest) ProtoReflect

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

func (*TransferRequest) Reset

func (x *TransferRequest) Reset()

func (*TransferRequest) String

func (x *TransferRequest) String() string

func (*TransferRequest) Validate

func (m *TransferRequest) Validate() error

Validate checks the field values on TransferRequest 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 (*TransferRequest) ValidateAll

func (m *TransferRequest) ValidateAll() error

ValidateAll checks the field values on TransferRequest 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 TransferRequestMultiError, or nil if none found.

type TransferRequestMultiError

type TransferRequestMultiError []error

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

func (TransferRequestMultiError) AllErrors

func (m TransferRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (TransferRequestMultiError) Error

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

type TransferRequestValidationError

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

TransferRequestValidationError is the validation error returned by TransferRequest.Validate if the designated constraints aren't met.

func (TransferRequestValidationError) Cause

Cause function returns cause value.

func (TransferRequestValidationError) Error

Error satisfies the builtin error interface

func (TransferRequestValidationError) ErrorName

func (e TransferRequestValidationError) ErrorName() string

ErrorName returns error name.

func (TransferRequestValidationError) Field

Field function returns field value.

func (TransferRequestValidationError) Key

Key function returns key value.

func (TransferRequestValidationError) Reason

Reason function returns reason value.

type TransferServer

type TransferServer interface {
	// 转账
	Transfer(context.Context, *TransferRequest) (*TransferReply, error)
	// 转出
	TransOut(context.Context, *TransOutRequest) (*TransOutReply, error)
	// 转入
	TransIn(context.Context, *TransInRequest) (*TransInReply, error)
	// contains filtered or unexported methods
}

TransferServer is the server API for Transfer service. All implementations must embed UnimplementedTransferServer for forward compatibility

type UnimplementedTransferServer

type UnimplementedTransferServer struct {
}

UnimplementedTransferServer must be embedded to have forward compatible implementations.

func (UnimplementedTransferServer) TransIn

func (UnimplementedTransferServer) TransOut

func (UnimplementedTransferServer) Transfer

type UnsafeTransferServer

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

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

Jump to

Keyboard shortcuts

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