Documentation
¶
Index ¶
- Variables
- func RegisterGobaseServer(s grpc.ServiceRegistrar, srv GobaseServer)
- type CreateUserReq
- func (*CreateUserReq) Descriptor() ([]byte, []int)deprecated
- func (x *CreateUserReq) GetAge() int64
- func (x *CreateUserReq) GetName() string
- func (x *CreateUserReq) GetOther() *WrapInt
- func (*CreateUserReq) ProtoMessage()
- func (x *CreateUserReq) ProtoReflect() protoreflect.Message
- func (x *CreateUserReq) Reset()
- func (x *CreateUserReq) String() string
- type ERR_CODE
- type GobaseClient
- type GobaseServer
- type UnimplementedGobaseServer
- type UnsafeGobaseServer
- type UserInfo
- func (*UserInfo) Descriptor() ([]byte, []int)deprecated
- func (x *UserInfo) GetAge() int64
- func (x *UserInfo) GetId() int64
- func (x *UserInfo) GetName() string
- func (*UserInfo) ProtoMessage()
- func (x *UserInfo) ProtoReflect() protoreflect.Message
- func (x *UserInfo) Reset()
- func (x *UserInfo) String() string
- type WrapInt
Constants ¶
This section is empty.
Variables ¶
var ( ERR_CODE_name = map[int32]string{ 0: "ERR_CODE_NONE", 1001: "USER_NOT_EXISTS", 1002: "USER_ALREADY_EXISTS", 1003: "EMAIL_FORMAT_ERROR", 1004: "EMAIL_ALREADY_EXISTS", 1005: "PHONE_FORMAT_ERROR", 1006: "PHONE_ALREADY_EXISTS", 1007: "TOKEN_EXPIRED", 1008: "TOKEN_NOT_INPUT", 1009: "TOKEN_INVALID", 1010: "PASSWORD_WRONG", 1011: "V_CODE_WRONG", 1012: "OAUTH_WITH_THIRD_FAILED", 1013: "AUTH_METHOD_UNKNOWN", 1014: "INPUT_DATA_FORMAT_ERROR", 1015: "MISSING_REQUIRED_FIELDS", 1016: "IDENTITY_TYPE_NOT_SUPPORT", 1017: "SERVICE_UNAVAILABLE", } ERR_CODE_value = map[string]int32{ "ERR_CODE_NONE": 0, "USER_NOT_EXISTS": 1001, "USER_ALREADY_EXISTS": 1002, "EMAIL_FORMAT_ERROR": 1003, "EMAIL_ALREADY_EXISTS": 1004, "PHONE_FORMAT_ERROR": 1005, "PHONE_ALREADY_EXISTS": 1006, "TOKEN_EXPIRED": 1007, "TOKEN_NOT_INPUT": 1008, "TOKEN_INVALID": 1009, "PASSWORD_WRONG": 1010, "V_CODE_WRONG": 1011, "OAUTH_WITH_THIRD_FAILED": 1012, "AUTH_METHOD_UNKNOWN": 1013, "INPUT_DATA_FORMAT_ERROR": 1014, "MISSING_REQUIRED_FIELDS": 1015, "IDENTITY_TYPE_NOT_SUPPORT": 1016, "SERVICE_UNAVAILABLE": 1017, } )
Enum value maps for ERR_CODE.
var File_gobase_v1_error_code_proto protoreflect.FileDescriptor
var File_gobase_v1_gobase_proto protoreflect.FileDescriptor
var File_gobase_v1_other_proto protoreflect.FileDescriptor
var Gobase_ServiceDesc = grpc.ServiceDesc{ ServiceName: "gobase.v1.Gobase", HandlerType: (*GobaseServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateUser", Handler: _Gobase_CreateUser_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "gobase/v1/gobase.proto", }
Gobase_ServiceDesc is the grpc.ServiceDesc for Gobase service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterGobaseServer ¶
func RegisterGobaseServer(s grpc.ServiceRegistrar, srv GobaseServer)
Types ¶
type CreateUserReq ¶
type CreateUserReq struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Age *int64 `protobuf:"varint,2,opt,name=age,proto3,oneof" json:"age,omitempty"` Other *WrapInt `protobuf:"bytes,3,opt,name=other,proto3" json:"other,omitempty"` // contains filtered or unexported fields }
func (*CreateUserReq) Descriptor
deprecated
func (*CreateUserReq) Descriptor() ([]byte, []int)
Deprecated: Use CreateUserReq.ProtoReflect.Descriptor instead.
func (*CreateUserReq) GetAge ¶
func (x *CreateUserReq) GetAge() int64
func (*CreateUserReq) GetName ¶
func (x *CreateUserReq) GetName() string
func (*CreateUserReq) GetOther ¶
func (x *CreateUserReq) GetOther() *WrapInt
func (*CreateUserReq) ProtoMessage ¶
func (*CreateUserReq) ProtoMessage()
func (*CreateUserReq) ProtoReflect ¶
func (x *CreateUserReq) ProtoReflect() protoreflect.Message
func (*CreateUserReq) Reset ¶
func (x *CreateUserReq) Reset()
func (*CreateUserReq) String ¶
func (x *CreateUserReq) String() string
type ERR_CODE ¶
type ERR_CODE int32
错误码列表
const ( ERR_CODE_ERR_CODE_NONE ERR_CODE = 0 // 0 占位 ERR_CODE_USER_NOT_EXISTS ERR_CODE = 1001 ERR_CODE_USER_ALREADY_EXISTS ERR_CODE = 1002 ERR_CODE_EMAIL_FORMAT_ERROR ERR_CODE = 1003 ERR_CODE_EMAIL_ALREADY_EXISTS ERR_CODE = 1004 ERR_CODE_PHONE_FORMAT_ERROR ERR_CODE = 1005 ERR_CODE_PHONE_ALREADY_EXISTS ERR_CODE = 1006 ERR_CODE_TOKEN_EXPIRED ERR_CODE = 1007 ERR_CODE_TOKEN_NOT_INPUT ERR_CODE = 1008 ERR_CODE_TOKEN_INVALID ERR_CODE = 1009 ERR_CODE_PASSWORD_WRONG ERR_CODE = 1010 ERR_CODE_V_CODE_WRONG ERR_CODE = 1011 ERR_CODE_OAUTH_WITH_THIRD_FAILED ERR_CODE = 1012 ERR_CODE_AUTH_METHOD_UNKNOWN ERR_CODE = 1013 ERR_CODE_INPUT_DATA_FORMAT_ERROR ERR_CODE = 1014 ERR_CODE_MISSING_REQUIRED_FIELDS ERR_CODE = 1015 ERR_CODE_IDENTITY_TYPE_NOT_SUPPORT ERR_CODE = 1016 ERR_CODE_SERVICE_UNAVAILABLE ERR_CODE = 1017 )
func (ERR_CODE) Descriptor ¶
func (ERR_CODE) Descriptor() protoreflect.EnumDescriptor
func (ERR_CODE) EnumDescriptor
deprecated
func (ERR_CODE) Number ¶
func (x ERR_CODE) Number() protoreflect.EnumNumber
func (ERR_CODE) Type ¶
func (ERR_CODE) Type() protoreflect.EnumType
type GobaseClient ¶
type GobaseClient interface {
CreateUser(ctx context.Context, in *CreateUserReq, opts ...grpc.CallOption) (*UserInfo, error)
}
GobaseClient is the client API for Gobase service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkgo.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewGobaseClient ¶
func NewGobaseClient(cc grpc.ClientConnInterface) GobaseClient
type GobaseServer ¶
type GobaseServer interface { CreateUser(context.Context, *CreateUserReq) (*UserInfo, error) // contains filtered or unexported methods }
GobaseServer is the server API for Gobase service. All implementations must embed UnimplementedGobaseServer for forward compatibility
type UnimplementedGobaseServer ¶
type UnimplementedGobaseServer struct { }
UnimplementedGobaseServer must be embedded to have forward compatible implementations.
func (UnimplementedGobaseServer) CreateUser ¶
func (UnimplementedGobaseServer) CreateUser(context.Context, *CreateUserReq) (*UserInfo, error)
type UnsafeGobaseServer ¶
type UnsafeGobaseServer interface {
// contains filtered or unexported methods
}
UnsafeGobaseServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to GobaseServer will result in compilation errors.
type UserInfo ¶
type UserInfo struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Age *int64 `protobuf:"varint,3,opt,name=age,proto3,oneof" json:"age,omitempty"` // contains filtered or unexported fields }
func (*UserInfo) Descriptor
deprecated
func (*UserInfo) ProtoMessage ¶
func (*UserInfo) ProtoMessage()
func (*UserInfo) ProtoReflect ¶
func (x *UserInfo) ProtoReflect() protoreflect.Message
type WrapInt ¶
type WrapInt struct { Value int32 `protobuf:"varint,1,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
func (*WrapInt) Descriptor
deprecated
func (*WrapInt) ProtoMessage ¶
func (*WrapInt) ProtoMessage()
func (*WrapInt) ProtoReflect ¶
func (x *WrapInt) ProtoReflect() protoreflect.Message