v1

package
v0.0.0-...-b9ebfcf Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Grpc_GetUserInfo_FullMethodName = "/api.grpc.v1.Grpc/GetUserInfo"
)

Variables

View Source
var File_grpc_v1_grpc_proto protoreflect.FileDescriptor
View Source
var Grpc_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.grpc.v1.Grpc",
	HandlerType: (*GrpcServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetUserInfo",
			Handler:    _Grpc_GetUserInfo_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "grpc/v1/grpc.proto",
}

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

Functions

func RegisterGrpcServer

func RegisterGrpcServer(s grpc.ServiceRegistrar, srv GrpcServer)

Types

type GrpcClient

type GrpcClient interface {
	// 获取用户信息
	GetUserInfo(ctx context.Context, in *UserInfoRequest, opts ...grpc.CallOption) (*UserInfoResponse, error)
}

GrpcClient is the client API for Grpc 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 NewGrpcClient

func NewGrpcClient(cc grpc.ClientConnInterface) GrpcClient

type GrpcServer

type GrpcServer interface {
	// 获取用户信息
	GetUserInfo(context.Context, *UserInfoRequest) (*UserInfoResponse, error)
	// contains filtered or unexported methods
}

GrpcServer is the server API for Grpc service. All implementations must embed UnimplementedGrpcServer for forward compatibility

type UnimplementedGrpcServer

type UnimplementedGrpcServer struct {
}

UnimplementedGrpcServer must be embedded to have forward compatible implementations.

func (UnimplementedGrpcServer) GetUserInfo

type UnsafeGrpcServer

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

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

type UserInfoRequest

type UserInfoRequest struct {

	// 用户名
	UserName string `protobuf:"bytes,1,opt,name=userName,proto3" json:"userName,omitempty"`
	// contains filtered or unexported fields
}

获取用户信息请求结构体

func (*UserInfoRequest) Descriptor deprecated

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

Deprecated: Use UserInfoRequest.ProtoReflect.Descriptor instead.

func (*UserInfoRequest) GetUserName

func (x *UserInfoRequest) GetUserName() string

func (*UserInfoRequest) ProtoMessage

func (*UserInfoRequest) ProtoMessage()

func (*UserInfoRequest) ProtoReflect

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

func (*UserInfoRequest) Reset

func (x *UserInfoRequest) Reset()

func (*UserInfoRequest) String

func (x *UserInfoRequest) String() string

func (*UserInfoRequest) Validate

func (m *UserInfoRequest) Validate() error

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

func (m *UserInfoRequest) ValidateAll() error

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

type UserInfoRequestMultiError

type UserInfoRequestMultiError []error

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

func (UserInfoRequestMultiError) AllErrors

func (m UserInfoRequestMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UserInfoRequestMultiError) Error

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

type UserInfoRequestValidationError

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

UserInfoRequestValidationError is the validation error returned by UserInfoRequest.Validate if the designated constraints aren't met.

func (UserInfoRequestValidationError) Cause

Cause function returns cause value.

func (UserInfoRequestValidationError) Error

Error satisfies the builtin error interface

func (UserInfoRequestValidationError) ErrorName

func (e UserInfoRequestValidationError) ErrorName() string

ErrorName returns error name.

func (UserInfoRequestValidationError) Field

Field function returns field value.

func (UserInfoRequestValidationError) Key

Key function returns key value.

func (UserInfoRequestValidationError) Reason

Reason function returns reason value.

type UserInfoResponse

type UserInfoResponse struct {

	// 返回码
	Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	// contains filtered or unexported fields
}

获取用户信息返回结构体

func (*UserInfoResponse) Descriptor deprecated

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

Deprecated: Use UserInfoResponse.ProtoReflect.Descriptor instead.

func (*UserInfoResponse) GetCode

func (x *UserInfoResponse) GetCode() int32

func (*UserInfoResponse) ProtoMessage

func (*UserInfoResponse) ProtoMessage()

func (*UserInfoResponse) ProtoReflect

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

func (*UserInfoResponse) Reset

func (x *UserInfoResponse) Reset()

func (*UserInfoResponse) String

func (x *UserInfoResponse) String() string

func (*UserInfoResponse) Validate

func (m *UserInfoResponse) Validate() error

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

func (m *UserInfoResponse) ValidateAll() error

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

type UserInfoResponseMultiError

type UserInfoResponseMultiError []error

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

func (UserInfoResponseMultiError) AllErrors

func (m UserInfoResponseMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (UserInfoResponseMultiError) Error

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

type UserInfoResponseValidationError

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

UserInfoResponseValidationError is the validation error returned by UserInfoResponse.Validate if the designated constraints aren't met.

func (UserInfoResponseValidationError) Cause

Cause function returns cause value.

func (UserInfoResponseValidationError) Error

Error satisfies the builtin error interface

func (UserInfoResponseValidationError) ErrorName

ErrorName returns error name.

func (UserInfoResponseValidationError) Field

Field function returns field value.

func (UserInfoResponseValidationError) Key

Key function returns key value.

func (UserInfoResponseValidationError) Reason

Reason function returns reason value.

Jump to

Keyboard shortcuts

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