Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterUserHTTPServer(s *http.Server, srv UserHTTPServer)
- func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
- type CreateUserReply
- type CreateUserRequest
- func (*CreateUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUserRequest) GetEmail() string
- func (x *CreateUserRequest) GetIsAdmin() int32
- func (x *CreateUserRequest) GetLoginAt() *timestamppb.Timestamp
- func (x *CreateUserRequest) GetMeta() *v1.ObjectMeta
- func (x *CreateUserRequest) GetNickname() string
- func (x *CreateUserRequest) GetPassword() string
- func (x *CreateUserRequest) GetPhone() string
- func (x *CreateUserRequest) GetStatus() int32
- func (x *CreateUserRequest) GetTotalPolicy() int64
- func (*CreateUserRequest) ProtoMessage()
- func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
- func (x *CreateUserRequest) Reset()
- func (x *CreateUserRequest) String() string
- type ErrorReason
- func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
- func (x ErrorReason) Enum() *ErrorReason
- func (ErrorReason) EnumDescriptor() ([]byte, []int)deprecated
- func (x ErrorReason) Number() protoreflect.EnumNumber
- func (x ErrorReason) String() string
- func (ErrorReason) Type() protoreflect.EnumType
- type GetUserRequest
- func (*GetUserRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetUserRequest) GetEmail() string
- func (x *GetUserRequest) GetId() uint64
- func (x *GetUserRequest) GetNickname() string
- func (x *GetUserRequest) GetPhone() string
- func (x *GetUserRequest) GetStatus() int32
- func (*GetUserRequest) ProtoMessage()
- func (x *GetUserRequest) ProtoReflect() protoreflect.Message
- func (x *GetUserRequest) Reset()
- func (x *GetUserRequest) String() string
- type UnimplementedUserServer
- type UnsafeUserServer
- type UserClient
- type UserHTTPClient
- type UserHTTPClientImpl
- type UserHTTPServer
- type UserReply
- func (*UserReply) Descriptor() ([]byte, []int)deprecated
- func (x *UserReply) GetEmail() string
- func (x *UserReply) GetIsAdmin() int32
- func (x *UserReply) GetLoginAt() *timestamppb.Timestamp
- func (x *UserReply) GetMeta() *v1.ObjectMeta
- func (x *UserReply) GetNickname() string
- func (x *UserReply) GetPhone() string
- func (x *UserReply) GetStatus() int32
- func (x *UserReply) GetTotalPolicy() int64
- func (*UserReply) ProtoMessage()
- func (x *UserReply) ProtoReflect() protoreflect.Message
- func (x *UserReply) Reset()
- func (x *UserReply) String() string
- type UserServer
Constants ¶
const ( User_Create_FullMethodName = "/user.v1.User/Create" User_Get_FullMethodName = "/user.v1.User/Get" )
const OperationUserCreate = "/user.v1.User/Create"
const OperationUserGet = "/user.v1.User/Get"
Variables ¶
var ( ErrorReason_name = map[int32]string{ 0: "GREETER_UNSPECIFIED", 1: "USER_NOT_FOUND", } ErrorReason_value = map[string]int32{ "GREETER_UNSPECIFIED": 0, "USER_NOT_FOUND": 1, } )
Enum value maps for ErrorReason.
var File_user_v1_error_reason_proto protoreflect.FileDescriptor
var File_user_v1_user_proto protoreflect.FileDescriptor
var User_ServiceDesc = grpc.ServiceDesc{ ServiceName: "user.v1.User", HandlerType: (*UserServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Create", Handler: _User_Create_Handler, }, { MethodName: "Get", Handler: _User_Get_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "user/v1/user.proto", }
User_ServiceDesc is the grpc.ServiceDesc for User service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterUserHTTPServer ¶
func RegisterUserHTTPServer(s *http.Server, srv UserHTTPServer)
func RegisterUserServer ¶
func RegisterUserServer(s grpc.ServiceRegistrar, srv UserServer)
Types ¶
type CreateUserReply ¶
type CreateUserReply struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*CreateUserReply) Descriptor
deprecated
func (*CreateUserReply) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserReply.ProtoReflect.Descriptor instead.
func (*CreateUserReply) GetId ¶
func (x *CreateUserReply) GetId() uint64
func (*CreateUserReply) ProtoMessage ¶
func (*CreateUserReply) ProtoMessage()
func (*CreateUserReply) ProtoReflect ¶
func (x *CreateUserReply) ProtoReflect() protoreflect.Message
func (*CreateUserReply) Reset ¶
func (x *CreateUserReply) Reset()
func (*CreateUserReply) String ¶
func (x *CreateUserReply) String() string
type CreateUserRequest ¶
type CreateUserRequest struct { Meta *v1.ObjectMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` Nickname string `protobuf:"bytes,3,opt,name=nickname,proto3" json:"nickname,omitempty"` Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"` Email string `protobuf:"bytes,5,opt,name=email,proto3" json:"email,omitempty"` Phone string `protobuf:"bytes,6,opt,name=phone,proto3" json:"phone,omitempty"` IsAdmin int32 `protobuf:"varint,7,opt,name=is_admin,json=isAdmin,proto3" json:"is_admin,omitempty"` TotalPolicy int64 `protobuf:"varint,8,opt,name=total_policy,json=totalPolicy,proto3" json:"total_policy,omitempty"` LoginAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=login_at,json=loginAt,proto3" json:"login_at,omitempty"` // contains filtered or unexported fields }
func (*CreateUserRequest) Descriptor
deprecated
func (*CreateUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.
func (*CreateUserRequest) GetEmail ¶
func (x *CreateUserRequest) GetEmail() string
func (*CreateUserRequest) GetIsAdmin ¶
func (x *CreateUserRequest) GetIsAdmin() int32
func (*CreateUserRequest) GetLoginAt ¶
func (x *CreateUserRequest) GetLoginAt() *timestamppb.Timestamp
func (*CreateUserRequest) GetMeta ¶
func (x *CreateUserRequest) GetMeta() *v1.ObjectMeta
func (*CreateUserRequest) GetNickname ¶
func (x *CreateUserRequest) GetNickname() string
func (*CreateUserRequest) GetPassword ¶
func (x *CreateUserRequest) GetPassword() string
func (*CreateUserRequest) GetPhone ¶
func (x *CreateUserRequest) GetPhone() string
func (*CreateUserRequest) GetStatus ¶
func (x *CreateUserRequest) GetStatus() int32
func (*CreateUserRequest) GetTotalPolicy ¶
func (x *CreateUserRequest) GetTotalPolicy() int64
func (*CreateUserRequest) ProtoMessage ¶
func (*CreateUserRequest) ProtoMessage()
func (*CreateUserRequest) ProtoReflect ¶
func (x *CreateUserRequest) ProtoReflect() protoreflect.Message
func (*CreateUserRequest) Reset ¶
func (x *CreateUserRequest) Reset()
func (*CreateUserRequest) String ¶
func (x *CreateUserRequest) String() string
type ErrorReason ¶
type ErrorReason int32
const ( ErrorReason_GREETER_UNSPECIFIED ErrorReason = 0 ErrorReason_USER_NOT_FOUND ErrorReason = 1 )
func (ErrorReason) Descriptor ¶
func (ErrorReason) Descriptor() protoreflect.EnumDescriptor
func (ErrorReason) Enum ¶
func (x ErrorReason) Enum() *ErrorReason
func (ErrorReason) EnumDescriptor
deprecated
func (ErrorReason) EnumDescriptor() ([]byte, []int)
Deprecated: Use ErrorReason.Descriptor instead.
func (ErrorReason) Number ¶
func (x ErrorReason) Number() protoreflect.EnumNumber
func (ErrorReason) String ¶
func (x ErrorReason) String() string
func (ErrorReason) Type ¶
func (ErrorReason) Type() protoreflect.EnumType
type GetUserRequest ¶
type GetUserRequest struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"` Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"` Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"` Status int32 `protobuf:"varint,5,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
func (*GetUserRequest) Descriptor
deprecated
func (*GetUserRequest) Descriptor() ([]byte, []int)
Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.
func (*GetUserRequest) GetEmail ¶
func (x *GetUserRequest) GetEmail() string
func (*GetUserRequest) GetId ¶
func (x *GetUserRequest) GetId() uint64
func (*GetUserRequest) GetNickname ¶
func (x *GetUserRequest) GetNickname() string
func (*GetUserRequest) GetPhone ¶
func (x *GetUserRequest) GetPhone() string
func (*GetUserRequest) GetStatus ¶
func (x *GetUserRequest) GetStatus() int32
func (*GetUserRequest) ProtoMessage ¶
func (*GetUserRequest) ProtoMessage()
func (*GetUserRequest) ProtoReflect ¶
func (x *GetUserRequest) ProtoReflect() protoreflect.Message
func (*GetUserRequest) Reset ¶
func (x *GetUserRequest) Reset()
func (*GetUserRequest) String ¶
func (x *GetUserRequest) String() string
type UnimplementedUserServer ¶
type UnimplementedUserServer struct { }
UnimplementedUserServer must be embedded to have forward compatible implementations.
func (UnimplementedUserServer) Create ¶
func (UnimplementedUserServer) Create(context.Context, *CreateUserRequest) (*CreateUserReply, error)
func (UnimplementedUserServer) Get ¶
func (UnimplementedUserServer) Get(context.Context, *GetUserRequest) (*UserReply, error)
type UnsafeUserServer ¶
type UnsafeUserServer interface {
// contains filtered or unexported methods
}
UnsafeUserServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to UserServer will result in compilation errors.
type UserClient ¶
type UserClient interface { Create(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*CreateUserReply, error) Get(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*UserReply, error) }
UserClient is the client API for User 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 NewUserClient ¶
func NewUserClient(cc grpc.ClientConnInterface) UserClient
type UserHTTPClient ¶
type UserHTTPClient interface { Create(ctx context.Context, req *CreateUserRequest, opts ...http.CallOption) (rsp *CreateUserReply, err error) Get(ctx context.Context, req *GetUserRequest, opts ...http.CallOption) (rsp *UserReply, err error) }
func NewUserHTTPClient ¶
func NewUserHTTPClient(client *http.Client) UserHTTPClient
type UserHTTPClientImpl ¶
type UserHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*UserHTTPClientImpl) Create ¶
func (c *UserHTTPClientImpl) Create(ctx context.Context, in *CreateUserRequest, opts ...http.CallOption) (*CreateUserReply, error)
func (*UserHTTPClientImpl) Get ¶
func (c *UserHTTPClientImpl) Get(ctx context.Context, in *GetUserRequest, opts ...http.CallOption) (*UserReply, error)
type UserHTTPServer ¶
type UserHTTPServer interface { Create(context.Context, *CreateUserRequest) (*CreateUserReply, error) Get(context.Context, *GetUserRequest) (*UserReply, error) }
type UserReply ¶
type UserReply struct { Meta *v1.ObjectMeta `protobuf:"bytes,1,opt,name=meta,proto3" json:"meta,omitempty"` Status int32 `protobuf:"varint,2,opt,name=status,proto3" json:"status,omitempty"` Nickname string `protobuf:"bytes,3,opt,name=nickname,proto3" json:"nickname,omitempty"` Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` Phone string `protobuf:"bytes,5,opt,name=phone,proto3" json:"phone,omitempty"` IsAdmin int32 `protobuf:"varint,6,opt,name=is_admin,json=isAdmin,proto3" json:"is_admin,omitempty"` TotalPolicy int64 `protobuf:"varint,7,opt,name=total_policy,json=totalPolicy,proto3" json:"total_policy,omitempty"` LoginAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=login_at,json=loginAt,proto3" json:"login_at,omitempty"` // contains filtered or unexported fields }
func (*UserReply) Descriptor
deprecated
func (*UserReply) GetIsAdmin ¶
func (*UserReply) GetLoginAt ¶
func (x *UserReply) GetLoginAt() *timestamppb.Timestamp
func (*UserReply) GetMeta ¶
func (x *UserReply) GetMeta() *v1.ObjectMeta
func (*UserReply) GetNickname ¶
func (*UserReply) GetTotalPolicy ¶
func (*UserReply) ProtoMessage ¶
func (*UserReply) ProtoMessage()
func (*UserReply) ProtoReflect ¶
func (x *UserReply) ProtoReflect() protoreflect.Message
type UserServer ¶
type UserServer interface { Create(context.Context, *CreateUserRequest) (*CreateUserReply, error) Get(context.Context, *GetUserRequest) (*UserReply, error) // contains filtered or unexported methods }
UserServer is the server API for User service. All implementations must embed UnimplementedUserServer for forward compatibility