Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterAuthHTTPServer(s *http.Server, srv AuthHTTPServer)
- func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer)
- type AuthClient
- type AuthHTTPClient
- type AuthHTTPClientImpl
- func (c *AuthHTTPClientImpl) Captcha(ctx context.Context, in *CaptchaRequest, opts ...http.CallOption) (*CaptchaReply, error)
- func (c *AuthHTTPClientImpl) Login(ctx context.Context, in *LoginRequest, opts ...http.CallOption) (*LoginReply, error)
- func (c *AuthHTTPClientImpl) Logout(ctx context.Context, in *LogoutRequest, opts ...http.CallOption) (*LogoutReply, error)
- func (c *AuthHTTPClientImpl) RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...http.CallOption) (*RefreshTokenReply, error)
- type AuthHTTPServer
- type AuthServer
- type CaptchaReply
- func (*CaptchaReply) Descriptor() ([]byte, []int)deprecated
- func (x *CaptchaReply) GetCaptcha() string
- func (x *CaptchaReply) GetCaptchaId() string
- func (*CaptchaReply) ProtoMessage()
- func (x *CaptchaReply) ProtoReflect() protoreflect.Message
- func (x *CaptchaReply) Reset()
- func (x *CaptchaReply) String() string
- func (m *CaptchaReply) Validate() error
- func (m *CaptchaReply) ValidateAll() error
- type CaptchaReplyMultiError
- type CaptchaReplyValidationError
- func (e CaptchaReplyValidationError) Cause() error
- func (e CaptchaReplyValidationError) Error() string
- func (e CaptchaReplyValidationError) ErrorName() string
- func (e CaptchaReplyValidationError) Field() string
- func (e CaptchaReplyValidationError) Key() bool
- func (e CaptchaReplyValidationError) Reason() string
- type CaptchaRequest
- func (*CaptchaRequest) Descriptor() ([]byte, []int)deprecated
- func (x *CaptchaRequest) GetCaptchaType() api.CaptchaType
- func (x *CaptchaRequest) GetTheme() string
- func (x *CaptchaRequest) GetX() uint64
- func (x *CaptchaRequest) GetY() uint64
- func (*CaptchaRequest) ProtoMessage()
- func (x *CaptchaRequest) ProtoReflect() protoreflect.Message
- func (x *CaptchaRequest) Reset()
- func (x *CaptchaRequest) String() string
- func (m *CaptchaRequest) Validate() error
- func (m *CaptchaRequest) ValidateAll() error
- type CaptchaRequestMultiError
- type CaptchaRequestValidationError
- func (e CaptchaRequestValidationError) Cause() error
- func (e CaptchaRequestValidationError) Error() string
- func (e CaptchaRequestValidationError) ErrorName() string
- func (e CaptchaRequestValidationError) Field() string
- func (e CaptchaRequestValidationError) Key() bool
- func (e CaptchaRequestValidationError) Reason() string
- type LoginReply
- func (*LoginReply) Descriptor() ([]byte, []int)deprecated
- func (x *LoginReply) GetToken() string
- func (x *LoginReply) GetUser() *api.UserV1
- func (*LoginReply) ProtoMessage()
- func (x *LoginReply) ProtoReflect() protoreflect.Message
- func (x *LoginReply) Reset()
- func (x *LoginReply) String() string
- func (m *LoginReply) Validate() error
- func (m *LoginReply) ValidateAll() error
- type LoginReplyMultiError
- type LoginReplyValidationError
- type LoginRequest
- func (*LoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *LoginRequest) GetCaptchaId() string
- func (x *LoginRequest) GetCode() string
- func (x *LoginRequest) GetPassword() string
- func (x *LoginRequest) GetUsername() string
- func (*LoginRequest) ProtoMessage()
- func (x *LoginRequest) ProtoReflect() protoreflect.Message
- func (x *LoginRequest) Reset()
- func (x *LoginRequest) String() string
- func (m *LoginRequest) Validate() error
- func (m *LoginRequest) ValidateAll() error
- type LoginRequestMultiError
- type LoginRequestValidationError
- func (e LoginRequestValidationError) Cause() error
- func (e LoginRequestValidationError) Error() string
- func (e LoginRequestValidationError) ErrorName() string
- func (e LoginRequestValidationError) Field() string
- func (e LoginRequestValidationError) Key() bool
- func (e LoginRequestValidationError) Reason() string
- type LogoutReply
- func (*LogoutReply) Descriptor() ([]byte, []int)deprecated
- func (x *LogoutReply) GetUserId() uint32
- func (*LogoutReply) ProtoMessage()
- func (x *LogoutReply) ProtoReflect() protoreflect.Message
- func (x *LogoutReply) Reset()
- func (x *LogoutReply) String() string
- func (m *LogoutReply) Validate() error
- func (m *LogoutReply) ValidateAll() error
- type LogoutReplyMultiError
- type LogoutReplyValidationError
- func (e LogoutReplyValidationError) Cause() error
- func (e LogoutReplyValidationError) Error() string
- func (e LogoutReplyValidationError) ErrorName() string
- func (e LogoutReplyValidationError) Field() string
- func (e LogoutReplyValidationError) Key() bool
- func (e LogoutReplyValidationError) Reason() string
- type LogoutRequest
- func (*LogoutRequest) Descriptor() ([]byte, []int)deprecated
- func (*LogoutRequest) ProtoMessage()
- func (x *LogoutRequest) ProtoReflect() protoreflect.Message
- func (x *LogoutRequest) Reset()
- func (x *LogoutRequest) String() string
- func (m *LogoutRequest) Validate() error
- func (m *LogoutRequest) ValidateAll() error
- type LogoutRequestMultiError
- type LogoutRequestValidationError
- func (e LogoutRequestValidationError) Cause() error
- func (e LogoutRequestValidationError) Error() string
- func (e LogoutRequestValidationError) ErrorName() string
- func (e LogoutRequestValidationError) Field() string
- func (e LogoutRequestValidationError) Key() bool
- func (e LogoutRequestValidationError) Reason() string
- type RefreshTokenReply
- func (*RefreshTokenReply) Descriptor() ([]byte, []int)deprecated
- func (x *RefreshTokenReply) GetToken() string
- func (x *RefreshTokenReply) GetUser() *api.UserV1
- func (*RefreshTokenReply) ProtoMessage()
- func (x *RefreshTokenReply) ProtoReflect() protoreflect.Message
- func (x *RefreshTokenReply) Reset()
- func (x *RefreshTokenReply) String() string
- func (m *RefreshTokenReply) Validate() error
- func (m *RefreshTokenReply) ValidateAll() error
- type RefreshTokenReplyMultiError
- type RefreshTokenReplyValidationError
- func (e RefreshTokenReplyValidationError) Cause() error
- func (e RefreshTokenReplyValidationError) Error() string
- func (e RefreshTokenReplyValidationError) ErrorName() string
- func (e RefreshTokenReplyValidationError) Field() string
- func (e RefreshTokenReplyValidationError) Key() bool
- func (e RefreshTokenReplyValidationError) Reason() string
- type RefreshTokenRequest
- func (*RefreshTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *RefreshTokenRequest) GetRoleId() uint32
- func (*RefreshTokenRequest) ProtoMessage()
- func (x *RefreshTokenRequest) ProtoReflect() protoreflect.Message
- func (x *RefreshTokenRequest) Reset()
- func (x *RefreshTokenRequest) String() string
- func (m *RefreshTokenRequest) Validate() error
- func (m *RefreshTokenRequest) ValidateAll() error
- type RefreshTokenRequestMultiError
- type RefreshTokenRequestValidationError
- func (e RefreshTokenRequestValidationError) Cause() error
- func (e RefreshTokenRequestValidationError) Error() string
- func (e RefreshTokenRequestValidationError) ErrorName() string
- func (e RefreshTokenRequestValidationError) Field() string
- func (e RefreshTokenRequestValidationError) Key() bool
- func (e RefreshTokenRequestValidationError) Reason() string
- type UnimplementedAuthServer
- func (UnimplementedAuthServer) Captcha(context.Context, *CaptchaRequest) (*CaptchaReply, error)
- func (UnimplementedAuthServer) Login(context.Context, *LoginRequest) (*LoginReply, error)
- func (UnimplementedAuthServer) Logout(context.Context, *LogoutRequest) (*LogoutReply, error)
- func (UnimplementedAuthServer) RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenReply, error)
- type UnsafeAuthServer
Constants ¶
const ( Auth_Login_FullMethodName = "/api.server.auth.Auth/Login" Auth_Logout_FullMethodName = "/api.server.auth.Auth/Logout" Auth_RefreshToken_FullMethodName = "/api.server.auth.Auth/RefreshToken" Auth_Captcha_FullMethodName = "/api.server.auth.Auth/Captcha" )
const OperationAuthCaptcha = "/api.server.auth.Auth/Captcha"
const OperationAuthLogin = "/api.server.auth.Auth/Login"
const OperationAuthLogout = "/api.server.auth.Auth/Logout"
const OperationAuthRefreshToken = "/api.server.auth.Auth/RefreshToken"
Variables ¶
var Auth_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.server.auth.Auth", HandlerType: (*AuthServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Login", Handler: _Auth_Login_Handler, }, { MethodName: "Logout", Handler: _Auth_Logout_Handler, }, { MethodName: "RefreshToken", Handler: _Auth_RefreshToken_Handler, }, { MethodName: "Captcha", Handler: _Auth_Captcha_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "server/auth/auth.proto", }
Auth_ServiceDesc is the grpc.ServiceDesc for Auth service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_server_auth_auth_proto protoreflect.FileDescriptor
Functions ¶
func RegisterAuthHTTPServer ¶
func RegisterAuthHTTPServer(s *http.Server, srv AuthHTTPServer)
func RegisterAuthServer ¶
func RegisterAuthServer(s grpc.ServiceRegistrar, srv AuthServer)
Types ¶
type AuthClient ¶
type AuthClient interface { // 登录(目前是通过用户名+密码方式) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginReply, error) // 登出, 清除token Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutReply, error) // 刷新token, 过期时间为1天, 切换角色也是用该接口 RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...grpc.CallOption) (*RefreshTokenReply, error) // 获取验证码, 验证码有几种类型, 具体见CaptchaType Captcha(ctx context.Context, in *CaptchaRequest, opts ...grpc.CallOption) (*CaptchaReply, error) }
AuthClient is the client API for Auth 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 NewAuthClient ¶
func NewAuthClient(cc grpc.ClientConnInterface) AuthClient
type AuthHTTPClient ¶
type AuthHTTPClient interface { Captcha(ctx context.Context, req *CaptchaRequest, opts ...http.CallOption) (rsp *CaptchaReply, err error) Login(ctx context.Context, req *LoginRequest, opts ...http.CallOption) (rsp *LoginReply, err error) Logout(ctx context.Context, req *LogoutRequest, opts ...http.CallOption) (rsp *LogoutReply, err error) RefreshToken(ctx context.Context, req *RefreshTokenRequest, opts ...http.CallOption) (rsp *RefreshTokenReply, err error) }
func NewAuthHTTPClient ¶
func NewAuthHTTPClient(client *http.Client) AuthHTTPClient
type AuthHTTPClientImpl ¶
type AuthHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*AuthHTTPClientImpl) Captcha ¶
func (c *AuthHTTPClientImpl) Captcha(ctx context.Context, in *CaptchaRequest, opts ...http.CallOption) (*CaptchaReply, error)
func (*AuthHTTPClientImpl) Login ¶
func (c *AuthHTTPClientImpl) Login(ctx context.Context, in *LoginRequest, opts ...http.CallOption) (*LoginReply, error)
func (*AuthHTTPClientImpl) Logout ¶
func (c *AuthHTTPClientImpl) Logout(ctx context.Context, in *LogoutRequest, opts ...http.CallOption) (*LogoutReply, error)
func (*AuthHTTPClientImpl) RefreshToken ¶
func (c *AuthHTTPClientImpl) RefreshToken(ctx context.Context, in *RefreshTokenRequest, opts ...http.CallOption) (*RefreshTokenReply, error)
type AuthHTTPServer ¶
type AuthHTTPServer interface { // Captcha 获取验证码, 验证码有几种类型, 具体见CaptchaType Captcha(context.Context, *CaptchaRequest) (*CaptchaReply, error) // Login 登录(目前是通过用户名+密码方式) Login(context.Context, *LoginRequest) (*LoginReply, error) // Logout 登出, 清除token Logout(context.Context, *LogoutRequest) (*LogoutReply, error) // RefreshToken 刷新token, 过期时间为1天, 切换角色也是用该接口 RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenReply, error) }
type AuthServer ¶
type AuthServer interface { // 登录(目前是通过用户名+密码方式) Login(context.Context, *LoginRequest) (*LoginReply, error) // 登出, 清除token Logout(context.Context, *LogoutRequest) (*LogoutReply, error) // 刷新token, 过期时间为1天, 切换角色也是用该接口 RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenReply, error) // 获取验证码, 验证码有几种类型, 具体见CaptchaType Captcha(context.Context, *CaptchaRequest) (*CaptchaReply, error) // contains filtered or unexported methods }
AuthServer is the server API for Auth service. All implementations must embed UnimplementedAuthServer for forward compatibility
type CaptchaReply ¶
type CaptchaReply struct { // 验证码base64信息, 如果是图片验证码, 则直接使用img标签展示即可, 如果是音频验证码, 则需要调用相关接口播放音频 Captcha string `protobuf:"bytes,1,opt,name=captcha,proto3" json:"captcha,omitempty"` // 验证码标识ID, 验证的时候需要传递该值 CaptchaId string `protobuf:"bytes,2,opt,name=captchaId,proto3" json:"captchaId,omitempty"` // contains filtered or unexported fields }
获取验证码返回参数
func (*CaptchaReply) Descriptor
deprecated
func (*CaptchaReply) Descriptor() ([]byte, []int)
Deprecated: Use CaptchaReply.ProtoReflect.Descriptor instead.
func (*CaptchaReply) GetCaptcha ¶
func (x *CaptchaReply) GetCaptcha() string
func (*CaptchaReply) GetCaptchaId ¶
func (x *CaptchaReply) GetCaptchaId() string
func (*CaptchaReply) ProtoMessage ¶
func (*CaptchaReply) ProtoMessage()
func (*CaptchaReply) ProtoReflect ¶
func (x *CaptchaReply) ProtoReflect() protoreflect.Message
func (*CaptchaReply) Reset ¶
func (x *CaptchaReply) Reset()
func (*CaptchaReply) String ¶
func (x *CaptchaReply) String() string
func (*CaptchaReply) Validate ¶
func (m *CaptchaReply) Validate() error
Validate checks the field values on CaptchaReply 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 (*CaptchaReply) ValidateAll ¶
func (m *CaptchaReply) ValidateAll() error
ValidateAll checks the field values on CaptchaReply 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 CaptchaReplyMultiError, or nil if none found.
type CaptchaReplyMultiError ¶
type CaptchaReplyMultiError []error
CaptchaReplyMultiError is an error wrapping multiple validation errors returned by CaptchaReply.ValidateAll() if the designated constraints aren't met.
func (CaptchaReplyMultiError) AllErrors ¶
func (m CaptchaReplyMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CaptchaReplyMultiError) Error ¶
func (m CaptchaReplyMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CaptchaReplyValidationError ¶
type CaptchaReplyValidationError struct {
// contains filtered or unexported fields
}
CaptchaReplyValidationError is the validation error returned by CaptchaReply.Validate if the designated constraints aren't met.
func (CaptchaReplyValidationError) Cause ¶
func (e CaptchaReplyValidationError) Cause() error
Cause function returns cause value.
func (CaptchaReplyValidationError) Error ¶
func (e CaptchaReplyValidationError) Error() string
Error satisfies the builtin error interface
func (CaptchaReplyValidationError) ErrorName ¶
func (e CaptchaReplyValidationError) ErrorName() string
ErrorName returns error name.
func (CaptchaReplyValidationError) Field ¶
func (e CaptchaReplyValidationError) Field() string
Field function returns field value.
func (CaptchaReplyValidationError) Key ¶
func (e CaptchaReplyValidationError) Key() bool
Key function returns key value.
func (CaptchaReplyValidationError) Reason ¶
func (e CaptchaReplyValidationError) Reason() string
Reason function returns reason value.
type CaptchaRequest ¶
type CaptchaRequest struct { // 验证码宽度 X uint64 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` // 验证码高度 Y uint64 `protobuf:"varint,2,opt,name=y,proto3" json:"y,omitempty"` // 验证码类型 CaptchaType api.CaptchaType `protobuf:"varint,3,opt,name=captcha_type,json=captchaType,proto3,enum=api.CaptchaType" json:"captcha_type,omitempty"` // 主题 Theme string `protobuf:"bytes,4,opt,name=theme,proto3" json:"theme,omitempty"` // contains filtered or unexported fields }
获取验证码请求参数
func (*CaptchaRequest) Descriptor
deprecated
func (*CaptchaRequest) Descriptor() ([]byte, []int)
Deprecated: Use CaptchaRequest.ProtoReflect.Descriptor instead.
func (*CaptchaRequest) GetCaptchaType ¶
func (x *CaptchaRequest) GetCaptchaType() api.CaptchaType
func (*CaptchaRequest) GetTheme ¶
func (x *CaptchaRequest) GetTheme() string
func (*CaptchaRequest) GetX ¶
func (x *CaptchaRequest) GetX() uint64
func (*CaptchaRequest) GetY ¶
func (x *CaptchaRequest) GetY() uint64
func (*CaptchaRequest) ProtoMessage ¶
func (*CaptchaRequest) ProtoMessage()
func (*CaptchaRequest) ProtoReflect ¶
func (x *CaptchaRequest) ProtoReflect() protoreflect.Message
func (*CaptchaRequest) Reset ¶
func (x *CaptchaRequest) Reset()
func (*CaptchaRequest) String ¶
func (x *CaptchaRequest) String() string
func (*CaptchaRequest) Validate ¶
func (m *CaptchaRequest) Validate() error
Validate checks the field values on CaptchaRequest 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 (*CaptchaRequest) ValidateAll ¶
func (m *CaptchaRequest) ValidateAll() error
ValidateAll checks the field values on CaptchaRequest 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 CaptchaRequestMultiError, or nil if none found.
type CaptchaRequestMultiError ¶
type CaptchaRequestMultiError []error
CaptchaRequestMultiError is an error wrapping multiple validation errors returned by CaptchaRequest.ValidateAll() if the designated constraints aren't met.
func (CaptchaRequestMultiError) AllErrors ¶
func (m CaptchaRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CaptchaRequestMultiError) Error ¶
func (m CaptchaRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CaptchaRequestValidationError ¶
type CaptchaRequestValidationError struct {
// contains filtered or unexported fields
}
CaptchaRequestValidationError is the validation error returned by CaptchaRequest.Validate if the designated constraints aren't met.
func (CaptchaRequestValidationError) Cause ¶
func (e CaptchaRequestValidationError) Cause() error
Cause function returns cause value.
func (CaptchaRequestValidationError) Error ¶
func (e CaptchaRequestValidationError) Error() string
Error satisfies the builtin error interface
func (CaptchaRequestValidationError) ErrorName ¶
func (e CaptchaRequestValidationError) ErrorName() string
ErrorName returns error name.
func (CaptchaRequestValidationError) Field ¶
func (e CaptchaRequestValidationError) Field() string
Field function returns field value.
func (CaptchaRequestValidationError) Key ¶
func (e CaptchaRequestValidationError) Key() bool
Key function returns key value.
func (CaptchaRequestValidationError) Reason ¶
func (e CaptchaRequestValidationError) Reason() string
Reason function returns reason value.
type LoginReply ¶
type LoginReply struct { // 登录token Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // 用户详情 User *api.UserV1 `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
登录返回参数
func (*LoginReply) Descriptor
deprecated
func (*LoginReply) Descriptor() ([]byte, []int)
Deprecated: Use LoginReply.ProtoReflect.Descriptor instead.
func (*LoginReply) GetToken ¶
func (x *LoginReply) GetToken() string
func (*LoginReply) GetUser ¶
func (x *LoginReply) GetUser() *api.UserV1
func (*LoginReply) ProtoMessage ¶
func (*LoginReply) ProtoMessage()
func (*LoginReply) ProtoReflect ¶
func (x *LoginReply) ProtoReflect() protoreflect.Message
func (*LoginReply) Reset ¶
func (x *LoginReply) Reset()
func (*LoginReply) String ¶
func (x *LoginReply) String() string
func (*LoginReply) Validate ¶
func (m *LoginReply) Validate() error
Validate checks the field values on LoginReply 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 (*LoginReply) ValidateAll ¶
func (m *LoginReply) ValidateAll() error
ValidateAll checks the field values on LoginReply 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 LoginReplyMultiError, or nil if none found.
type LoginReplyMultiError ¶
type LoginReplyMultiError []error
LoginReplyMultiError is an error wrapping multiple validation errors returned by LoginReply.ValidateAll() if the designated constraints aren't met.
func (LoginReplyMultiError) AllErrors ¶
func (m LoginReplyMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (LoginReplyMultiError) Error ¶
func (m LoginReplyMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type LoginReplyValidationError ¶
type LoginReplyValidationError struct {
// contains filtered or unexported fields
}
LoginReplyValidationError is the validation error returned by LoginReply.Validate if the designated constraints aren't met.
func (LoginReplyValidationError) Cause ¶
func (e LoginReplyValidationError) Cause() error
Cause function returns cause value.
func (LoginReplyValidationError) Error ¶
func (e LoginReplyValidationError) Error() string
Error satisfies the builtin error interface
func (LoginReplyValidationError) ErrorName ¶
func (e LoginReplyValidationError) ErrorName() string
ErrorName returns error name.
func (LoginReplyValidationError) Field ¶
func (e LoginReplyValidationError) Field() string
Field function returns field value.
func (LoginReplyValidationError) Key ¶
func (e LoginReplyValidationError) Key() bool
Key function returns key value.
func (LoginReplyValidationError) Reason ¶
func (e LoginReplyValidationError) Reason() string
Reason function returns reason value.
type LoginRequest ¶
type LoginRequest struct { // 用户名 Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` // 密码 Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // 验证码 Code string `protobuf:"bytes,3,opt,name=code,proto3" json:"code,omitempty"` // 验证码id CaptchaId string `protobuf:"bytes,4,opt,name=captchaId,proto3" json:"captchaId,omitempty"` // contains filtered or unexported fields }
登录请求参数
func (*LoginRequest) Descriptor
deprecated
func (*LoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.
func (*LoginRequest) GetCaptchaId ¶
func (x *LoginRequest) GetCaptchaId() string
func (*LoginRequest) GetCode ¶
func (x *LoginRequest) GetCode() string
func (*LoginRequest) GetPassword ¶
func (x *LoginRequest) GetPassword() string
func (*LoginRequest) GetUsername ¶
func (x *LoginRequest) GetUsername() string
func (*LoginRequest) ProtoMessage ¶
func (*LoginRequest) ProtoMessage()
func (*LoginRequest) ProtoReflect ¶
func (x *LoginRequest) ProtoReflect() protoreflect.Message
func (*LoginRequest) Reset ¶
func (x *LoginRequest) Reset()
func (*LoginRequest) String ¶
func (x *LoginRequest) String() string
func (*LoginRequest) Validate ¶
func (m *LoginRequest) Validate() error
Validate checks the field values on LoginRequest 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 (*LoginRequest) ValidateAll ¶
func (m *LoginRequest) ValidateAll() error
ValidateAll checks the field values on LoginRequest 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 LoginRequestMultiError, or nil if none found.
type LoginRequestMultiError ¶
type LoginRequestMultiError []error
LoginRequestMultiError is an error wrapping multiple validation errors returned by LoginRequest.ValidateAll() if the designated constraints aren't met.
func (LoginRequestMultiError) AllErrors ¶
func (m LoginRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (LoginRequestMultiError) Error ¶
func (m LoginRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type LoginRequestValidationError ¶
type LoginRequestValidationError struct {
// contains filtered or unexported fields
}
LoginRequestValidationError is the validation error returned by LoginRequest.Validate if the designated constraints aren't met.
func (LoginRequestValidationError) Cause ¶
func (e LoginRequestValidationError) Cause() error
Cause function returns cause value.
func (LoginRequestValidationError) Error ¶
func (e LoginRequestValidationError) Error() string
Error satisfies the builtin error interface
func (LoginRequestValidationError) ErrorName ¶
func (e LoginRequestValidationError) ErrorName() string
ErrorName returns error name.
func (LoginRequestValidationError) Field ¶
func (e LoginRequestValidationError) Field() string
Field function returns field value.
func (LoginRequestValidationError) Key ¶
func (e LoginRequestValidationError) Key() bool
Key function returns key value.
func (LoginRequestValidationError) Reason ¶
func (e LoginRequestValidationError) Reason() string
Reason function returns reason value.
type LogoutReply ¶
type LogoutReply struct { // 响应信息, 如果成功, 则返回userId UserId uint32 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` // contains filtered or unexported fields }
登出返回参数
func (*LogoutReply) Descriptor
deprecated
func (*LogoutReply) Descriptor() ([]byte, []int)
Deprecated: Use LogoutReply.ProtoReflect.Descriptor instead.
func (*LogoutReply) GetUserId ¶
func (x *LogoutReply) GetUserId() uint32
func (*LogoutReply) ProtoMessage ¶
func (*LogoutReply) ProtoMessage()
func (*LogoutReply) ProtoReflect ¶
func (x *LogoutReply) ProtoReflect() protoreflect.Message
func (*LogoutReply) Reset ¶
func (x *LogoutReply) Reset()
func (*LogoutReply) String ¶
func (x *LogoutReply) String() string
func (*LogoutReply) Validate ¶
func (m *LogoutReply) Validate() error
Validate checks the field values on LogoutReply 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 (*LogoutReply) ValidateAll ¶
func (m *LogoutReply) ValidateAll() error
ValidateAll checks the field values on LogoutReply 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 LogoutReplyMultiError, or nil if none found.
type LogoutReplyMultiError ¶
type LogoutReplyMultiError []error
LogoutReplyMultiError is an error wrapping multiple validation errors returned by LogoutReply.ValidateAll() if the designated constraints aren't met.
func (LogoutReplyMultiError) AllErrors ¶
func (m LogoutReplyMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (LogoutReplyMultiError) Error ¶
func (m LogoutReplyMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type LogoutReplyValidationError ¶
type LogoutReplyValidationError struct {
// contains filtered or unexported fields
}
LogoutReplyValidationError is the validation error returned by LogoutReply.Validate if the designated constraints aren't met.
func (LogoutReplyValidationError) Cause ¶
func (e LogoutReplyValidationError) Cause() error
Cause function returns cause value.
func (LogoutReplyValidationError) Error ¶
func (e LogoutReplyValidationError) Error() string
Error satisfies the builtin error interface
func (LogoutReplyValidationError) ErrorName ¶
func (e LogoutReplyValidationError) ErrorName() string
ErrorName returns error name.
func (LogoutReplyValidationError) Field ¶
func (e LogoutReplyValidationError) Field() string
Field function returns field value.
func (LogoutReplyValidationError) Key ¶
func (e LogoutReplyValidationError) Key() bool
Key function returns key value.
func (LogoutReplyValidationError) Reason ¶
func (e LogoutReplyValidationError) Reason() string
Reason function returns reason value.
type LogoutRequest ¶
type LogoutRequest struct {
// contains filtered or unexported fields
}
登出请求参数(登出不需要参数, 这里只是为了站位)
func (*LogoutRequest) Descriptor
deprecated
func (*LogoutRequest) Descriptor() ([]byte, []int)
Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead.
func (*LogoutRequest) ProtoMessage ¶
func (*LogoutRequest) ProtoMessage()
func (*LogoutRequest) ProtoReflect ¶
func (x *LogoutRequest) ProtoReflect() protoreflect.Message
func (*LogoutRequest) Reset ¶
func (x *LogoutRequest) Reset()
func (*LogoutRequest) String ¶
func (x *LogoutRequest) String() string
func (*LogoutRequest) Validate ¶
func (m *LogoutRequest) Validate() error
Validate checks the field values on LogoutRequest 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 (*LogoutRequest) ValidateAll ¶
func (m *LogoutRequest) ValidateAll() error
ValidateAll checks the field values on LogoutRequest 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 LogoutRequestMultiError, or nil if none found.
type LogoutRequestMultiError ¶
type LogoutRequestMultiError []error
LogoutRequestMultiError is an error wrapping multiple validation errors returned by LogoutRequest.ValidateAll() if the designated constraints aren't met.
func (LogoutRequestMultiError) AllErrors ¶
func (m LogoutRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (LogoutRequestMultiError) Error ¶
func (m LogoutRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type LogoutRequestValidationError ¶
type LogoutRequestValidationError struct {
// contains filtered or unexported fields
}
LogoutRequestValidationError is the validation error returned by LogoutRequest.Validate if the designated constraints aren't met.
func (LogoutRequestValidationError) Cause ¶
func (e LogoutRequestValidationError) Cause() error
Cause function returns cause value.
func (LogoutRequestValidationError) Error ¶
func (e LogoutRequestValidationError) Error() string
Error satisfies the builtin error interface
func (LogoutRequestValidationError) ErrorName ¶
func (e LogoutRequestValidationError) ErrorName() string
ErrorName returns error name.
func (LogoutRequestValidationError) Field ¶
func (e LogoutRequestValidationError) Field() string
Field function returns field value.
func (LogoutRequestValidationError) Key ¶
func (e LogoutRequestValidationError) Key() bool
Key function returns key value.
func (LogoutRequestValidationError) Reason ¶
func (e LogoutRequestValidationError) Reason() string
Reason function returns reason value.
type RefreshTokenReply ¶
type RefreshTokenReply struct { // JWT token, 需要在header中传递 Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // 用户详情 User *api.UserV1 `protobuf:"bytes,2,opt,name=user,proto3" json:"user,omitempty"` // contains filtered or unexported fields }
刷新token返回参数
func (*RefreshTokenReply) Descriptor
deprecated
func (*RefreshTokenReply) Descriptor() ([]byte, []int)
Deprecated: Use RefreshTokenReply.ProtoReflect.Descriptor instead.
func (*RefreshTokenReply) GetToken ¶
func (x *RefreshTokenReply) GetToken() string
func (*RefreshTokenReply) GetUser ¶
func (x *RefreshTokenReply) GetUser() *api.UserV1
func (*RefreshTokenReply) ProtoMessage ¶
func (*RefreshTokenReply) ProtoMessage()
func (*RefreshTokenReply) ProtoReflect ¶
func (x *RefreshTokenReply) ProtoReflect() protoreflect.Message
func (*RefreshTokenReply) Reset ¶
func (x *RefreshTokenReply) Reset()
func (*RefreshTokenReply) String ¶
func (x *RefreshTokenReply) String() string
func (*RefreshTokenReply) Validate ¶
func (m *RefreshTokenReply) Validate() error
Validate checks the field values on RefreshTokenReply 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 (*RefreshTokenReply) ValidateAll ¶
func (m *RefreshTokenReply) ValidateAll() error
ValidateAll checks the field values on RefreshTokenReply 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 RefreshTokenReplyMultiError, or nil if none found.
type RefreshTokenReplyMultiError ¶
type RefreshTokenReplyMultiError []error
RefreshTokenReplyMultiError is an error wrapping multiple validation errors returned by RefreshTokenReply.ValidateAll() if the designated constraints aren't met.
func (RefreshTokenReplyMultiError) AllErrors ¶
func (m RefreshTokenReplyMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (RefreshTokenReplyMultiError) Error ¶
func (m RefreshTokenReplyMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type RefreshTokenReplyValidationError ¶
type RefreshTokenReplyValidationError struct {
// contains filtered or unexported fields
}
RefreshTokenReplyValidationError is the validation error returned by RefreshTokenReply.Validate if the designated constraints aren't met.
func (RefreshTokenReplyValidationError) Cause ¶
func (e RefreshTokenReplyValidationError) Cause() error
Cause function returns cause value.
func (RefreshTokenReplyValidationError) Error ¶
func (e RefreshTokenReplyValidationError) Error() string
Error satisfies the builtin error interface
func (RefreshTokenReplyValidationError) ErrorName ¶
func (e RefreshTokenReplyValidationError) ErrorName() string
ErrorName returns error name.
func (RefreshTokenReplyValidationError) Field ¶
func (e RefreshTokenReplyValidationError) Field() string
Field function returns field value.
func (RefreshTokenReplyValidationError) Key ¶
func (e RefreshTokenReplyValidationError) Key() bool
Key function returns key value.
func (RefreshTokenReplyValidationError) Reason ¶
func (e RefreshTokenReplyValidationError) Reason() string
Reason function returns reason value.
type RefreshTokenRequest ¶
type RefreshTokenRequest struct { // 角色id, 不传则刷新当前token的角色, 相关角色可以通过查看用户详情接口得到该用户的角色列表信息 RoleId uint32 `protobuf:"varint,1,opt,name=roleId,proto3" json:"roleId,omitempty"` // contains filtered or unexported fields }
刷新token请求参数
func (*RefreshTokenRequest) Descriptor
deprecated
func (*RefreshTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use RefreshTokenRequest.ProtoReflect.Descriptor instead.
func (*RefreshTokenRequest) GetRoleId ¶
func (x *RefreshTokenRequest) GetRoleId() uint32
func (*RefreshTokenRequest) ProtoMessage ¶
func (*RefreshTokenRequest) ProtoMessage()
func (*RefreshTokenRequest) ProtoReflect ¶
func (x *RefreshTokenRequest) ProtoReflect() protoreflect.Message
func (*RefreshTokenRequest) Reset ¶
func (x *RefreshTokenRequest) Reset()
func (*RefreshTokenRequest) String ¶
func (x *RefreshTokenRequest) String() string
func (*RefreshTokenRequest) Validate ¶
func (m *RefreshTokenRequest) Validate() error
Validate checks the field values on RefreshTokenRequest 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 (*RefreshTokenRequest) ValidateAll ¶
func (m *RefreshTokenRequest) ValidateAll() error
ValidateAll checks the field values on RefreshTokenRequest 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 RefreshTokenRequestMultiError, or nil if none found.
type RefreshTokenRequestMultiError ¶
type RefreshTokenRequestMultiError []error
RefreshTokenRequestMultiError is an error wrapping multiple validation errors returned by RefreshTokenRequest.ValidateAll() if the designated constraints aren't met.
func (RefreshTokenRequestMultiError) AllErrors ¶
func (m RefreshTokenRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (RefreshTokenRequestMultiError) Error ¶
func (m RefreshTokenRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type RefreshTokenRequestValidationError ¶
type RefreshTokenRequestValidationError struct {
// contains filtered or unexported fields
}
RefreshTokenRequestValidationError is the validation error returned by RefreshTokenRequest.Validate if the designated constraints aren't met.
func (RefreshTokenRequestValidationError) Cause ¶
func (e RefreshTokenRequestValidationError) Cause() error
Cause function returns cause value.
func (RefreshTokenRequestValidationError) Error ¶
func (e RefreshTokenRequestValidationError) Error() string
Error satisfies the builtin error interface
func (RefreshTokenRequestValidationError) ErrorName ¶
func (e RefreshTokenRequestValidationError) ErrorName() string
ErrorName returns error name.
func (RefreshTokenRequestValidationError) Field ¶
func (e RefreshTokenRequestValidationError) Field() string
Field function returns field value.
func (RefreshTokenRequestValidationError) Key ¶
func (e RefreshTokenRequestValidationError) Key() bool
Key function returns key value.
func (RefreshTokenRequestValidationError) Reason ¶
func (e RefreshTokenRequestValidationError) Reason() string
Reason function returns reason value.
type UnimplementedAuthServer ¶
type UnimplementedAuthServer struct { }
UnimplementedAuthServer must be embedded to have forward compatible implementations.
func (UnimplementedAuthServer) Captcha ¶
func (UnimplementedAuthServer) Captcha(context.Context, *CaptchaRequest) (*CaptchaReply, error)
func (UnimplementedAuthServer) Login ¶
func (UnimplementedAuthServer) Login(context.Context, *LoginRequest) (*LoginReply, error)
func (UnimplementedAuthServer) Logout ¶
func (UnimplementedAuthServer) Logout(context.Context, *LogoutRequest) (*LogoutReply, error)
func (UnimplementedAuthServer) RefreshToken ¶
func (UnimplementedAuthServer) RefreshToken(context.Context, *RefreshTokenRequest) (*RefreshTokenReply, error)
type UnsafeAuthServer ¶
type UnsafeAuthServer interface {
// contains filtered or unexported methods
}
UnsafeAuthServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuthServer will result in compilation errors.