Documentation
¶
Index ¶
- Variables
- func RegisterUserServer(s *grpc.Server, srv UserServer)
- type EnumUserSex
- func (EnumUserSex) Descriptor() protoreflect.EnumDescriptor
- func (x EnumUserSex) Enum() *EnumUserSex
- func (EnumUserSex) EnumDescriptor() ([]byte, []int)deprecated
- func (x EnumUserSex) Number() protoreflect.EnumNumber
- func (x EnumUserSex) String() string
- func (EnumUserSex) Type() protoreflect.EnumType
- type UnimplementedUserServer
- func (*UnimplementedUserServer) UserDelete(context.Context, *UserDeleteRequest) (*UserDeleteResponse, error)
- func (*UnimplementedUserServer) UserIndex(context.Context, *UserIndexRequest) (*UserIndexResponse, error)
- func (*UnimplementedUserServer) UserPost(context.Context, *UserPostRequest) (*UserPostResponse, error)
- func (*UnimplementedUserServer) UserView(context.Context, *UserViewRequest) (*UserViewResponse, error)
- type UserClient
- type UserDeleteRequest
- type UserDeleteResponse
- func (*UserDeleteResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserDeleteResponse) GetCode() int32
- func (x *UserDeleteResponse) GetMsg() string
- func (*UserDeleteResponse) ProtoMessage()
- func (x *UserDeleteResponse) ProtoReflect() protoreflect.Message
- func (x *UserDeleteResponse) Reset()
- func (x *UserDeleteResponse) String() string
- type UserEntity
- type UserIndexRequest
- func (*UserIndexRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UserIndexRequest) GetPage() int32
- func (x *UserIndexRequest) GetPageSize() int32
- func (*UserIndexRequest) ProtoMessage()
- func (x *UserIndexRequest) ProtoReflect() protoreflect.Message
- func (x *UserIndexRequest) Reset()
- func (x *UserIndexRequest) String() string
- type UserIndexResponse
- func (*UserIndexResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserIndexResponse) GetCode() int32
- func (x *UserIndexResponse) GetData() []*UserEntity
- func (x *UserIndexResponse) GetMsg() string
- func (*UserIndexResponse) ProtoMessage()
- func (x *UserIndexResponse) ProtoReflect() protoreflect.Message
- func (x *UserIndexResponse) Reset()
- func (x *UserIndexResponse) String() string
- type UserPostRequest
- func (*UserPostRequest) Descriptor() ([]byte, []int)deprecated
- func (x *UserPostRequest) GetAge() int32
- func (x *UserPostRequest) GetName() string
- func (x *UserPostRequest) GetPassword() string
- func (*UserPostRequest) ProtoMessage()
- func (x *UserPostRequest) ProtoReflect() protoreflect.Message
- func (x *UserPostRequest) Reset()
- func (x *UserPostRequest) String() string
- type UserPostResponse
- func (*UserPostResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserPostResponse) GetCode() int32
- func (x *UserPostResponse) GetMsg() string
- func (*UserPostResponse) ProtoMessage()
- func (x *UserPostResponse) ProtoReflect() protoreflect.Message
- func (x *UserPostResponse) Reset()
- func (x *UserPostResponse) String() string
- type UserServer
- type UserViewRequest
- type UserViewResponse
- func (*UserViewResponse) Descriptor() ([]byte, []int)deprecated
- func (x *UserViewResponse) GetCode() int32
- func (x *UserViewResponse) GetData() *UserEntity
- func (x *UserViewResponse) GetMsg() string
- func (*UserViewResponse) ProtoMessage()
- func (x *UserViewResponse) ProtoReflect() protoreflect.Message
- func (x *UserViewResponse) Reset()
- func (x *UserViewResponse) String() string
Constants ¶
This section is empty.
Variables ¶
var ( EnumUserSex_name = map[int32]string{ 0: "SEX_INIT", 1: "SEX_MALE", 2: "SEX_FEMALE", } EnumUserSex_value = map[string]int32{ "SEX_INIT": 0, "SEX_MALE": 1, "SEX_FEMALE": 2, } )
Enum value maps for EnumUserSex.
var File_proto_user_user_proto protoreflect.FileDescriptor
Functions ¶
func RegisterUserServer ¶
func RegisterUserServer(s *grpc.Server, srv UserServer)
Types ¶
type EnumUserSex ¶
type EnumUserSex int32
枚举类型
const ( EnumUserSex_SEX_INIT EnumUserSex = 0 // 枚举类型必须以 0 起始 EnumUserSex_SEX_MALE EnumUserSex = 1 EnumUserSex_SEX_FEMALE EnumUserSex = 2 )
func (EnumUserSex) Descriptor ¶
func (EnumUserSex) Descriptor() protoreflect.EnumDescriptor
func (EnumUserSex) Enum ¶
func (x EnumUserSex) Enum() *EnumUserSex
func (EnumUserSex) EnumDescriptor
deprecated
func (EnumUserSex) EnumDescriptor() ([]byte, []int)
Deprecated: Use EnumUserSex.Descriptor instead.
func (EnumUserSex) Number ¶
func (x EnumUserSex) Number() protoreflect.EnumNumber
func (EnumUserSex) String ¶
func (x EnumUserSex) String() string
func (EnumUserSex) Type ¶
func (EnumUserSex) Type() protoreflect.EnumType
type UnimplementedUserServer ¶
type UnimplementedUserServer struct { }
UnimplementedUserServer can be embedded to have forward compatible implementations.
func (*UnimplementedUserServer) UserDelete ¶
func (*UnimplementedUserServer) UserDelete(context.Context, *UserDeleteRequest) (*UserDeleteResponse, error)
func (*UnimplementedUserServer) UserIndex ¶
func (*UnimplementedUserServer) UserIndex(context.Context, *UserIndexRequest) (*UserIndexResponse, error)
func (*UnimplementedUserServer) UserPost ¶
func (*UnimplementedUserServer) UserPost(context.Context, *UserPostRequest) (*UserPostResponse, error)
func (*UnimplementedUserServer) UserView ¶
func (*UnimplementedUserServer) UserView(context.Context, *UserViewRequest) (*UserViewResponse, error)
type UserClient ¶
type UserClient interface { UserIndex(ctx context.Context, in *UserIndexRequest, opts ...grpc.CallOption) (*UserIndexResponse, error) UserView(ctx context.Context, in *UserViewRequest, opts ...grpc.CallOption) (*UserViewResponse, error) UserPost(ctx context.Context, in *UserPostRequest, opts ...grpc.CallOption) (*UserPostResponse, error) UserDelete(ctx context.Context, in *UserDeleteRequest, opts ...grpc.CallOption) (*UserDeleteResponse, error) }
UserClient is the client API for User service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewUserClient ¶
func NewUserClient(cc grpc.ClientConnInterface) UserClient
type UserDeleteRequest ¶
type UserDeleteRequest struct { Uid int32 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // contains filtered or unexported fields }
func (*UserDeleteRequest) Descriptor
deprecated
func (*UserDeleteRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserDeleteRequest.ProtoReflect.Descriptor instead.
func (*UserDeleteRequest) GetUid ¶
func (x *UserDeleteRequest) GetUid() int32
func (*UserDeleteRequest) ProtoMessage ¶
func (*UserDeleteRequest) ProtoMessage()
func (*UserDeleteRequest) ProtoReflect ¶
func (x *UserDeleteRequest) ProtoReflect() protoreflect.Message
func (*UserDeleteRequest) Reset ¶
func (x *UserDeleteRequest) Reset()
func (*UserDeleteRequest) String ¶
func (x *UserDeleteRequest) String() string
type UserDeleteResponse ¶
type UserDeleteResponse struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // contains filtered or unexported fields }
func (*UserDeleteResponse) Descriptor
deprecated
func (*UserDeleteResponse) Descriptor() ([]byte, []int)
Deprecated: Use UserDeleteResponse.ProtoReflect.Descriptor instead.
func (*UserDeleteResponse) GetCode ¶
func (x *UserDeleteResponse) GetCode() int32
func (*UserDeleteResponse) GetMsg ¶
func (x *UserDeleteResponse) GetMsg() string
func (*UserDeleteResponse) ProtoMessage ¶
func (*UserDeleteResponse) ProtoMessage()
func (*UserDeleteResponse) ProtoReflect ¶
func (x *UserDeleteResponse) ProtoReflect() protoreflect.Message
func (*UserDeleteResponse) Reset ¶
func (x *UserDeleteResponse) Reset()
func (*UserDeleteResponse) String ¶
func (x *UserDeleteResponse) String() string
type UserEntity ¶
type UserEntity struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Age int32 `protobuf:"varint,2,opt,name=age,proto3" json:"age,omitempty"` // contains filtered or unexported fields }
用户实体模型
func (*UserEntity) Descriptor
deprecated
func (*UserEntity) Descriptor() ([]byte, []int)
Deprecated: Use UserEntity.ProtoReflect.Descriptor instead.
func (*UserEntity) GetAge ¶
func (x *UserEntity) GetAge() int32
func (*UserEntity) GetName ¶
func (x *UserEntity) GetName() string
func (*UserEntity) ProtoMessage ¶
func (*UserEntity) ProtoMessage()
func (*UserEntity) ProtoReflect ¶
func (x *UserEntity) ProtoReflect() protoreflect.Message
func (*UserEntity) Reset ¶
func (x *UserEntity) Reset()
func (*UserEntity) String ¶
func (x *UserEntity) String() string
type UserIndexRequest ¶
type UserIndexRequest struct { Page int32 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` PageSize int32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // contains filtered or unexported fields }
User 服务的各个接口的请求/响应结构
func (*UserIndexRequest) Descriptor
deprecated
func (*UserIndexRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserIndexRequest.ProtoReflect.Descriptor instead.
func (*UserIndexRequest) GetPage ¶
func (x *UserIndexRequest) GetPage() int32
func (*UserIndexRequest) GetPageSize ¶
func (x *UserIndexRequest) GetPageSize() int32
func (*UserIndexRequest) ProtoMessage ¶
func (*UserIndexRequest) ProtoMessage()
func (*UserIndexRequest) ProtoReflect ¶
func (x *UserIndexRequest) ProtoReflect() protoreflect.Message
func (*UserIndexRequest) Reset ¶
func (x *UserIndexRequest) Reset()
func (*UserIndexRequest) String ¶
func (x *UserIndexRequest) String() string
type UserIndexResponse ¶
type UserIndexResponse struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // 返回一个 UserEntity 对象的列表数据 Data []*UserEntity `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*UserIndexResponse) Descriptor
deprecated
func (*UserIndexResponse) Descriptor() ([]byte, []int)
Deprecated: Use UserIndexResponse.ProtoReflect.Descriptor instead.
func (*UserIndexResponse) GetCode ¶
func (x *UserIndexResponse) GetCode() int32
func (*UserIndexResponse) GetData ¶
func (x *UserIndexResponse) GetData() []*UserEntity
func (*UserIndexResponse) GetMsg ¶
func (x *UserIndexResponse) GetMsg() string
func (*UserIndexResponse) ProtoMessage ¶
func (*UserIndexResponse) ProtoMessage()
func (*UserIndexResponse) ProtoReflect ¶
func (x *UserIndexResponse) ProtoReflect() protoreflect.Message
func (*UserIndexResponse) Reset ¶
func (x *UserIndexResponse) Reset()
func (*UserIndexResponse) String ¶
func (x *UserIndexResponse) String() string
type UserPostRequest ¶
type UserPostRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` Age int32 `protobuf:"varint,3,opt,name=age,proto3" json:"age,omitempty"` // contains filtered or unexported fields }
func (*UserPostRequest) Descriptor
deprecated
func (*UserPostRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserPostRequest.ProtoReflect.Descriptor instead.
func (*UserPostRequest) GetAge ¶
func (x *UserPostRequest) GetAge() int32
func (*UserPostRequest) GetName ¶
func (x *UserPostRequest) GetName() string
func (*UserPostRequest) GetPassword ¶
func (x *UserPostRequest) GetPassword() string
func (*UserPostRequest) ProtoMessage ¶
func (*UserPostRequest) ProtoMessage()
func (*UserPostRequest) ProtoReflect ¶
func (x *UserPostRequest) ProtoReflect() protoreflect.Message
func (*UserPostRequest) Reset ¶
func (x *UserPostRequest) Reset()
func (*UserPostRequest) String ¶
func (x *UserPostRequest) String() string
type UserPostResponse ¶
type UserPostResponse struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // contains filtered or unexported fields }
func (*UserPostResponse) Descriptor
deprecated
func (*UserPostResponse) Descriptor() ([]byte, []int)
Deprecated: Use UserPostResponse.ProtoReflect.Descriptor instead.
func (*UserPostResponse) GetCode ¶
func (x *UserPostResponse) GetCode() int32
func (*UserPostResponse) GetMsg ¶
func (x *UserPostResponse) GetMsg() string
func (*UserPostResponse) ProtoMessage ¶
func (*UserPostResponse) ProtoMessage()
func (*UserPostResponse) ProtoReflect ¶
func (x *UserPostResponse) ProtoReflect() protoreflect.Message
func (*UserPostResponse) Reset ¶
func (x *UserPostResponse) Reset()
func (*UserPostResponse) String ¶
func (x *UserPostResponse) String() string
type UserServer ¶
type UserServer interface { UserIndex(context.Context, *UserIndexRequest) (*UserIndexResponse, error) UserView(context.Context, *UserViewRequest) (*UserViewResponse, error) UserPost(context.Context, *UserPostRequest) (*UserPostResponse, error) UserDelete(context.Context, *UserDeleteRequest) (*UserDeleteResponse, error) }
UserServer is the server API for User service.
type UserViewRequest ¶
type UserViewRequest struct { Uid int32 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` // contains filtered or unexported fields }
func (*UserViewRequest) Descriptor
deprecated
func (*UserViewRequest) Descriptor() ([]byte, []int)
Deprecated: Use UserViewRequest.ProtoReflect.Descriptor instead.
func (*UserViewRequest) GetUid ¶
func (x *UserViewRequest) GetUid() int32
func (*UserViewRequest) ProtoMessage ¶
func (*UserViewRequest) ProtoMessage()
func (*UserViewRequest) ProtoReflect ¶
func (x *UserViewRequest) ProtoReflect() protoreflect.Message
func (*UserViewRequest) Reset ¶
func (x *UserViewRequest) Reset()
func (*UserViewRequest) String ¶
func (x *UserViewRequest) String() string
type UserViewResponse ¶
type UserViewResponse struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` // 返回一个 UserEntity 对象 Data *UserEntity `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*UserViewResponse) Descriptor
deprecated
func (*UserViewResponse) Descriptor() ([]byte, []int)
Deprecated: Use UserViewResponse.ProtoReflect.Descriptor instead.
func (*UserViewResponse) GetCode ¶
func (x *UserViewResponse) GetCode() int32
func (*UserViewResponse) GetData ¶
func (x *UserViewResponse) GetData() *UserEntity
func (*UserViewResponse) GetMsg ¶
func (x *UserViewResponse) GetMsg() string
func (*UserViewResponse) ProtoMessage ¶
func (*UserViewResponse) ProtoMessage()
func (*UserViewResponse) ProtoReflect ¶
func (x *UserViewResponse) ProtoReflect() protoreflect.Message
func (*UserViewResponse) Reset ¶
func (x *UserViewResponse) Reset()
func (*UserViewResponse) String ¶
func (x *UserViewResponse) String() string