Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterGrpcServer(s grpc.ServiceRegistrar, srv GrpcServer)
- type GrpcClient
- type GrpcServer
- type UnimplementedGrpcServer
- type UnsafeGrpcServer
- type UserInfoRequest
- func (*UserInfoRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UserInfoRequest) GetUserName() string
- func (*UserInfoRequest) ProtoMessage()
- func (x *UserInfoRequest) ProtoReflect() protoreflect.Message
- func (x *UserInfoRequest) Reset()
- func (x *UserInfoRequest) String() string
- func (m *UserInfoRequest) Validate() error
- func (m *UserInfoRequest) ValidateAll() error
- type UserInfoRequestMultiError
- type UserInfoRequestValidationError
- func (e UserInfoRequestValidationError) Cause() error
- func (e UserInfoRequestValidationError) Error() string
- func (e UserInfoRequestValidationError) ErrorName() string
- func (e UserInfoRequestValidationError) Field() string
- func (e UserInfoRequestValidationError) Key() bool
- func (e UserInfoRequestValidationError) Reason() string
- type UserInfoResponse
- func (*UserInfoResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserInfoResponse) GetCode() int32
- func (*UserInfoResponse) ProtoMessage()
- func (x *UserInfoResponse) ProtoReflect() protoreflect.Message
- func (x *UserInfoResponse) Reset()
- func (x *UserInfoResponse) String() string
- func (m *UserInfoResponse) Validate() error
- func (m *UserInfoResponse) ValidateAll() error
- type UserInfoResponseMultiError
- type UserInfoResponseValidationError
- func (e UserInfoResponseValidationError) Cause() error
- func (e UserInfoResponseValidationError) Error() string
- func (e UserInfoResponseValidationError) ErrorName() string
- func (e UserInfoResponseValidationError) Field() string
- func (e UserInfoResponseValidationError) Key() bool
- func (e UserInfoResponseValidationError) Reason() string
Constants ¶
const (
Grpc_GetUserInfo_FullMethodName = "/api.grpc.v1.Grpc/GetUserInfo"
)
Variables ¶
var File_grpc_v1_grpc_proto protoreflect.FileDescriptor
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 ¶
func (UnimplementedGrpcServer) GetUserInfo(context.Context, *UserInfoRequest) (*UserInfoResponse, error)
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 ¶
func (m UserInfoRequestMultiError) Error() string
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 ¶
func (e UserInfoRequestValidationError) Cause() error
Cause function returns cause value.
func (UserInfoRequestValidationError) Error ¶
func (e UserInfoRequestValidationError) Error() string
Error satisfies the builtin error interface
func (UserInfoRequestValidationError) ErrorName ¶
func (e UserInfoRequestValidationError) ErrorName() string
ErrorName returns error name.
func (UserInfoRequestValidationError) Field ¶
func (e UserInfoRequestValidationError) Field() string
Field function returns field value.
func (UserInfoRequestValidationError) Key ¶
func (e UserInfoRequestValidationError) Key() bool
Key function returns key value.
func (UserInfoRequestValidationError) Reason ¶
func (e UserInfoRequestValidationError) Reason() string
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 ¶
func (m UserInfoResponseMultiError) Error() string
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 ¶
func (e UserInfoResponseValidationError) Cause() error
Cause function returns cause value.
func (UserInfoResponseValidationError) Error ¶
func (e UserInfoResponseValidationError) Error() string
Error satisfies the builtin error interface
func (UserInfoResponseValidationError) ErrorName ¶
func (e UserInfoResponseValidationError) ErrorName() string
ErrorName returns error name.
func (UserInfoResponseValidationError) Field ¶
func (e UserInfoResponseValidationError) Field() string
Field function returns field value.
func (UserInfoResponseValidationError) Key ¶
func (e UserInfoResponseValidationError) Key() bool
Key function returns key value.
func (UserInfoResponseValidationError) Reason ¶
func (e UserInfoResponseValidationError) Reason() string
Reason function returns reason value.