Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterOAuthHTTPServer(s *http.Server, srv OAuthHTTPServer)
- func RegisterOAuthServer(s grpc.ServiceRegistrar, srv OAuthServer)
- type AppleLoginCallbackRequest
- func (*AppleLoginCallbackRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AppleLoginCallbackRequest) GetCode() string
- func (x *AppleLoginCallbackRequest) GetIdToken() string
- func (x *AppleLoginCallbackRequest) GetState() string
- func (*AppleLoginCallbackRequest) ProtoMessage()
- func (x *AppleLoginCallbackRequest) ProtoReflect() protoreflect.Message
- func (x *AppleLoginCallbackRequest) Reset()
- func (x *AppleLoginCallbackRequest) String() string
- func (m *AppleLoginCallbackRequest) Validate() error
- func (m *AppleLoginCallbackRequest) ValidateAll() error
- type AppleLoginCallbackRequestMultiError
- type AppleLoginCallbackRequestValidationError
- func (e AppleLoginCallbackRequestValidationError) Cause() error
- func (e AppleLoginCallbackRequestValidationError) Error() string
- func (e AppleLoginCallbackRequestValidationError) ErrorName() string
- func (e AppleLoginCallbackRequestValidationError) Field() string
- func (e AppleLoginCallbackRequestValidationError) Key() bool
- func (e AppleLoginCallbackRequestValidationError) Reason() string
- type CallbackReply
- func (*CallbackReply) Descriptor() ([]byte, []int)deprecated
- func (x *CallbackReply) GetCode() int32
- func (x *CallbackReply) GetMessage() string
- func (*CallbackReply) ProtoMessage()
- func (x *CallbackReply) ProtoReflect() protoreflect.Message
- func (x *CallbackReply) Reset()
- func (x *CallbackReply) String() string
- func (m *CallbackReply) Validate() error
- func (m *CallbackReply) ValidateAll() error
- type CallbackReplyMultiError
- type CallbackReplyValidationError
- func (e CallbackReplyValidationError) Cause() error
- func (e CallbackReplyValidationError) Error() string
- func (e CallbackReplyValidationError) ErrorName() string
- func (e CallbackReplyValidationError) Field() string
- func (e CallbackReplyValidationError) Key() bool
- func (e CallbackReplyValidationError) Reason() string
- type LoginRedirectData
- func (*LoginRedirectData) Descriptor() ([]byte, []int)deprecated
- func (x *LoginRedirectData) GetRedirect() string
- func (*LoginRedirectData) ProtoMessage()
- func (x *LoginRedirectData) ProtoReflect() protoreflect.Message
- func (x *LoginRedirectData) Reset()
- func (x *LoginRedirectData) String() string
- func (m *LoginRedirectData) Validate() error
- func (m *LoginRedirectData) ValidateAll() error
- type LoginRedirectDataMultiError
- type LoginRedirectDataValidationError
- func (e LoginRedirectDataValidationError) Cause() error
- func (e LoginRedirectDataValidationError) Error() string
- func (e LoginRedirectDataValidationError) ErrorName() string
- func (e LoginRedirectDataValidationError) Field() string
- func (e LoginRedirectDataValidationError) Key() bool
- func (e LoginRedirectDataValidationError) Reason() string
- type LoginRedirectReply
- func (*LoginRedirectReply) Descriptor() ([]byte, []int)deprecated
- func (x *LoginRedirectReply) GetCode() int32
- func (x *LoginRedirectReply) GetData() *LoginRedirectData
- func (x *LoginRedirectReply) GetMessage() string
- func (*LoginRedirectReply) ProtoMessage()
- func (x *LoginRedirectReply) ProtoReflect() protoreflect.Message
- func (x *LoginRedirectReply) Reset()
- func (x *LoginRedirectReply) String() string
- func (m *LoginRedirectReply) Validate() error
- func (m *LoginRedirectReply) ValidateAll() error
- type LoginRedirectReplyMultiError
- type LoginRedirectReplyValidationError
- func (e LoginRedirectReplyValidationError) Cause() error
- func (e LoginRedirectReplyValidationError) Error() string
- func (e LoginRedirectReplyValidationError) ErrorName() string
- func (e LoginRedirectReplyValidationError) Field() string
- func (e LoginRedirectReplyValidationError) Key() bool
- func (e LoginRedirectReplyValidationError) Reason() string
- type LoginTokenData
- func (*LoginTokenData) Descriptor() ([]byte, []int)deprecated
- func (x *LoginTokenData) GetToken() string
- func (*LoginTokenData) ProtoMessage()
- func (x *LoginTokenData) ProtoReflect() protoreflect.Message
- func (x *LoginTokenData) Reset()
- func (x *LoginTokenData) String() string
- func (m *LoginTokenData) Validate() error
- func (m *LoginTokenData) ValidateAll() error
- type LoginTokenDataMultiError
- type LoginTokenDataValidationError
- func (e LoginTokenDataValidationError) Cause() error
- func (e LoginTokenDataValidationError) Error() string
- func (e LoginTokenDataValidationError) ErrorName() string
- func (e LoginTokenDataValidationError) Field() string
- func (e LoginTokenDataValidationError) Key() bool
- func (e LoginTokenDataValidationError) Reason() string
- type LoginTokenReply
- func (*LoginTokenReply) Descriptor() ([]byte, []int)deprecated
- func (x *LoginTokenReply) GetCode() int32
- func (x *LoginTokenReply) GetData() *LoginTokenData
- func (x *LoginTokenReply) GetMessage() string
- func (*LoginTokenReply) ProtoMessage()
- func (x *LoginTokenReply) ProtoReflect() protoreflect.Message
- func (x *LoginTokenReply) Reset()
- func (x *LoginTokenReply) String() string
- func (m *LoginTokenReply) Validate() error
- func (m *LoginTokenReply) ValidateAll() error
- type LoginTokenReplyMultiError
- type LoginTokenReplyValidationError
- func (e LoginTokenReplyValidationError) Cause() error
- func (e LoginTokenReplyValidationError) Error() string
- func (e LoginTokenReplyValidationError) ErrorName() string
- func (e LoginTokenReplyValidationError) Field() string
- func (e LoginTokenReplyValidationError) Key() bool
- func (e LoginTokenReplyValidationError) Reason() string
- type OAuthClient
- type OAuthHTTPClient
- type OAuthHTTPClientImpl
- func (c *OAuthHTTPClientImpl) AppleLoginCallback(ctx context.Context, in *AppleLoginCallbackRequest, opts ...http.CallOption) (*CallbackReply, error)
- func (c *OAuthHTTPClientImpl) OAuthLogin(ctx context.Context, in *OAuthLoginRequest, opts ...http.CallOption) (*LoginRedirectReply, error)
- func (c *OAuthHTTPClientImpl) OAuthLoginGetToken(ctx context.Context, in *OAuthLoginGetTokenRequest, opts ...http.CallOption) (*LoginTokenReply, error)
- type OAuthHTTPServer
- type OAuthLoginGetTokenRequest
- func (*OAuthLoginGetTokenRequest) Descriptor() ([]byte, []int)deprecated
- func (x *OAuthLoginGetTokenRequest) GetCallback() string
- func (x *OAuthLoginGetTokenRequest) GetIp() string
- func (x *OAuthLoginGetTokenRequest) GetMethod() string
- func (x *OAuthLoginGetTokenRequest) GetUserAgent() string
- func (*OAuthLoginGetTokenRequest) ProtoMessage()
- func (x *OAuthLoginGetTokenRequest) ProtoReflect() protoreflect.Message
- func (x *OAuthLoginGetTokenRequest) Reset()
- func (x *OAuthLoginGetTokenRequest) String() string
- func (m *OAuthLoginGetTokenRequest) Validate() error
- func (m *OAuthLoginGetTokenRequest) ValidateAll() error
- type OAuthLoginGetTokenRequestMultiError
- type OAuthLoginGetTokenRequestValidationError
- func (e OAuthLoginGetTokenRequestValidationError) Cause() error
- func (e OAuthLoginGetTokenRequestValidationError) Error() string
- func (e OAuthLoginGetTokenRequestValidationError) ErrorName() string
- func (e OAuthLoginGetTokenRequestValidationError) Field() string
- func (e OAuthLoginGetTokenRequestValidationError) Key() bool
- func (e OAuthLoginGetTokenRequestValidationError) Reason() string
- type OAuthLoginRequest
- func (*OAuthLoginRequest) Descriptor() ([]byte, []int)deprecated
- func (x *OAuthLoginRequest) GetMethod() string
- func (x *OAuthLoginRequest) GetRedirect() string
- func (*OAuthLoginRequest) ProtoMessage()
- func (x *OAuthLoginRequest) ProtoReflect() protoreflect.Message
- func (x *OAuthLoginRequest) Reset()
- func (x *OAuthLoginRequest) String() string
- func (m *OAuthLoginRequest) Validate() error
- func (m *OAuthLoginRequest) ValidateAll() error
- type OAuthLoginRequestMultiError
- type OAuthLoginRequestValidationError
- func (e OAuthLoginRequestValidationError) Cause() error
- func (e OAuthLoginRequestValidationError) Error() string
- func (e OAuthLoginRequestValidationError) ErrorName() string
- func (e OAuthLoginRequestValidationError) Field() string
- func (e OAuthLoginRequestValidationError) Key() bool
- func (e OAuthLoginRequestValidationError) Reason() string
- type OAuthServer
- type UnimplementedOAuthServer
- func (UnimplementedOAuthServer) AppleLoginCallback(context.Context, *AppleLoginCallbackRequest) (*CallbackReply, error)
- func (UnimplementedOAuthServer) OAuthLogin(context.Context, *OAuthLoginRequest) (*LoginRedirectReply, error)
- func (UnimplementedOAuthServer) OAuthLoginGetToken(context.Context, *OAuthLoginGetTokenRequest) (*LoginTokenReply, error)
- type UnsafeOAuthServer
Constants ¶
const ( OAuth_OAuthLogin_FullMethodName = "/api.auth.oauth.v1.OAuth/OAuthLogin" OAuth_OAuthLoginGetToken_FullMethodName = "/api.auth.oauth.v1.OAuth/OAuthLoginGetToken" OAuth_AppleLoginCallback_FullMethodName = "/api.auth.oauth.v1.OAuth/AppleLoginCallback" )
const OperationOAuthAppleLoginCallback = "/api.auth.oauth.v1.OAuth/AppleLoginCallback"
const OperationOAuthOAuthLogin = "/api.auth.oauth.v1.OAuth/OAuthLogin"
const OperationOAuthOAuthLoginGetToken = "/api.auth.oauth.v1.OAuth/OAuthLoginGetToken"
Variables ¶
var File_auth_oauth_v1_oauth_proto protoreflect.FileDescriptor
var OAuth_ServiceDesc = grpc.ServiceDesc{ ServiceName: "api.auth.oauth.v1.OAuth", HandlerType: (*OAuthServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "OAuthLogin", Handler: _OAuth_OAuthLogin_Handler, }, { MethodName: "OAuthLoginGetToken", Handler: _OAuth_OAuthLoginGetToken_Handler, }, { MethodName: "AppleLoginCallback", Handler: _OAuth_AppleLoginCallback_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "auth/oauth/v1/oauth.proto", }
OAuth_ServiceDesc is the grpc.ServiceDesc for OAuth service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterOAuthHTTPServer ¶
func RegisterOAuthHTTPServer(s *http.Server, srv OAuthHTTPServer)
func RegisterOAuthServer ¶
func RegisterOAuthServer(s grpc.ServiceRegistrar, srv OAuthServer)
Types ¶
type AppleLoginCallbackRequest ¶
type AppleLoginCallbackRequest struct {
Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` // Apple authorization code
IdToken string `protobuf:"bytes,2,opt,name=id_token,json=idToken,proto3" json:"id_token,omitempty"` // Apple ID token
State string `protobuf:"bytes,3,opt,name=state,proto3" json:"state,omitempty"` // State code for validation
// contains filtered or unexported fields
}
Apple登录回调请求
func (*AppleLoginCallbackRequest) Descriptor
deprecated
func (*AppleLoginCallbackRequest) Descriptor() ([]byte, []int)
Deprecated: Use AppleLoginCallbackRequest.ProtoReflect.Descriptor instead.
func (*AppleLoginCallbackRequest) GetCode ¶
func (x *AppleLoginCallbackRequest) GetCode() string
func (*AppleLoginCallbackRequest) GetIdToken ¶
func (x *AppleLoginCallbackRequest) GetIdToken() string
func (*AppleLoginCallbackRequest) GetState ¶
func (x *AppleLoginCallbackRequest) GetState() string
func (*AppleLoginCallbackRequest) ProtoMessage ¶
func (*AppleLoginCallbackRequest) ProtoMessage()
func (*AppleLoginCallbackRequest) ProtoReflect ¶
func (x *AppleLoginCallbackRequest) ProtoReflect() protoreflect.Message
func (*AppleLoginCallbackRequest) Reset ¶
func (x *AppleLoginCallbackRequest) Reset()
func (*AppleLoginCallbackRequest) String ¶
func (x *AppleLoginCallbackRequest) String() string
func (*AppleLoginCallbackRequest) Validate ¶
func (m *AppleLoginCallbackRequest) Validate() error
Validate checks the field values on AppleLoginCallbackRequest 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 (*AppleLoginCallbackRequest) ValidateAll ¶
func (m *AppleLoginCallbackRequest) ValidateAll() error
ValidateAll checks the field values on AppleLoginCallbackRequest 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 AppleLoginCallbackRequestMultiError, or nil if none found.
type AppleLoginCallbackRequestMultiError ¶
type AppleLoginCallbackRequestMultiError []error
AppleLoginCallbackRequestMultiError is an error wrapping multiple validation errors returned by AppleLoginCallbackRequest.ValidateAll() if the designated constraints aren't met.
func (AppleLoginCallbackRequestMultiError) AllErrors ¶
func (m AppleLoginCallbackRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (AppleLoginCallbackRequestMultiError) Error ¶
func (m AppleLoginCallbackRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type AppleLoginCallbackRequestValidationError ¶
type AppleLoginCallbackRequestValidationError struct {
// contains filtered or unexported fields
}
AppleLoginCallbackRequestValidationError is the validation error returned by AppleLoginCallbackRequest.Validate if the designated constraints aren't met.
func (AppleLoginCallbackRequestValidationError) Cause ¶
func (e AppleLoginCallbackRequestValidationError) Cause() error
Cause function returns cause value.
func (AppleLoginCallbackRequestValidationError) Error ¶
func (e AppleLoginCallbackRequestValidationError) Error() string
Error satisfies the builtin error interface
func (AppleLoginCallbackRequestValidationError) ErrorName ¶
func (e AppleLoginCallbackRequestValidationError) ErrorName() string
ErrorName returns error name.
func (AppleLoginCallbackRequestValidationError) Field ¶
func (e AppleLoginCallbackRequestValidationError) Field() string
Field function returns field value.
func (AppleLoginCallbackRequestValidationError) Key ¶
func (e AppleLoginCallbackRequestValidationError) Key() bool
Key function returns key value.
func (AppleLoginCallbackRequestValidationError) Reason ¶
func (e AppleLoginCallbackRequestValidationError) Reason() string
Reason function returns reason value.
type CallbackReply ¶
type CallbackReply struct {
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // 状态码
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // 消息内容
// contains filtered or unexported fields
}
CallbackReply 回调响应
func (*CallbackReply) Descriptor
deprecated
func (*CallbackReply) Descriptor() ([]byte, []int)
Deprecated: Use CallbackReply.ProtoReflect.Descriptor instead.
func (*CallbackReply) GetCode ¶
func (x *CallbackReply) GetCode() int32
func (*CallbackReply) GetMessage ¶
func (x *CallbackReply) GetMessage() string
func (*CallbackReply) ProtoMessage ¶
func (*CallbackReply) ProtoMessage()
func (*CallbackReply) ProtoReflect ¶
func (x *CallbackReply) ProtoReflect() protoreflect.Message
func (*CallbackReply) Reset ¶
func (x *CallbackReply) Reset()
func (*CallbackReply) String ¶
func (x *CallbackReply) String() string
func (*CallbackReply) Validate ¶
func (m *CallbackReply) Validate() error
Validate checks the field values on CallbackReply 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 (*CallbackReply) ValidateAll ¶
func (m *CallbackReply) ValidateAll() error
ValidateAll checks the field values on CallbackReply 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 CallbackReplyMultiError, or nil if none found.
type CallbackReplyMultiError ¶
type CallbackReplyMultiError []error
CallbackReplyMultiError is an error wrapping multiple validation errors returned by CallbackReply.ValidateAll() if the designated constraints aren't met.
func (CallbackReplyMultiError) AllErrors ¶
func (m CallbackReplyMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (CallbackReplyMultiError) Error ¶
func (m CallbackReplyMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type CallbackReplyValidationError ¶
type CallbackReplyValidationError struct {
// contains filtered or unexported fields
}
CallbackReplyValidationError is the validation error returned by CallbackReply.Validate if the designated constraints aren't met.
func (CallbackReplyValidationError) Cause ¶
func (e CallbackReplyValidationError) Cause() error
Cause function returns cause value.
func (CallbackReplyValidationError) Error ¶
func (e CallbackReplyValidationError) Error() string
Error satisfies the builtin error interface
func (CallbackReplyValidationError) ErrorName ¶
func (e CallbackReplyValidationError) ErrorName() string
ErrorName returns error name.
func (CallbackReplyValidationError) Field ¶
func (e CallbackReplyValidationError) Field() string
Field function returns field value.
func (CallbackReplyValidationError) Key ¶
func (e CallbackReplyValidationError) Key() bool
Key function returns key value.
func (CallbackReplyValidationError) Reason ¶
func (e CallbackReplyValidationError) Reason() string
Reason function returns reason value.
type LoginRedirectData ¶
type LoginRedirectData struct {
Redirect string `protobuf:"bytes,1,opt,name=redirect,proto3" json:"redirect,omitempty"` // OAuth提供商的授权URL
// contains filtered or unexported fields
}
LoginRedirectData OAuth登录重定向数据
func (*LoginRedirectData) Descriptor
deprecated
func (*LoginRedirectData) Descriptor() ([]byte, []int)
Deprecated: Use LoginRedirectData.ProtoReflect.Descriptor instead.
func (*LoginRedirectData) GetRedirect ¶
func (x *LoginRedirectData) GetRedirect() string
func (*LoginRedirectData) ProtoMessage ¶
func (*LoginRedirectData) ProtoMessage()
func (*LoginRedirectData) ProtoReflect ¶
func (x *LoginRedirectData) ProtoReflect() protoreflect.Message
func (*LoginRedirectData) Reset ¶
func (x *LoginRedirectData) Reset()
func (*LoginRedirectData) String ¶
func (x *LoginRedirectData) String() string
func (*LoginRedirectData) Validate ¶
func (m *LoginRedirectData) Validate() error
Validate checks the field values on LoginRedirectData 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 (*LoginRedirectData) ValidateAll ¶
func (m *LoginRedirectData) ValidateAll() error
ValidateAll checks the field values on LoginRedirectData 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 LoginRedirectDataMultiError, or nil if none found.
type LoginRedirectDataMultiError ¶
type LoginRedirectDataMultiError []error
LoginRedirectDataMultiError is an error wrapping multiple validation errors returned by LoginRedirectData.ValidateAll() if the designated constraints aren't met.
func (LoginRedirectDataMultiError) AllErrors ¶
func (m LoginRedirectDataMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (LoginRedirectDataMultiError) Error ¶
func (m LoginRedirectDataMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type LoginRedirectDataValidationError ¶
type LoginRedirectDataValidationError struct {
// contains filtered or unexported fields
}
LoginRedirectDataValidationError is the validation error returned by LoginRedirectData.Validate if the designated constraints aren't met.
func (LoginRedirectDataValidationError) Cause ¶
func (e LoginRedirectDataValidationError) Cause() error
Cause function returns cause value.
func (LoginRedirectDataValidationError) Error ¶
func (e LoginRedirectDataValidationError) Error() string
Error satisfies the builtin error interface
func (LoginRedirectDataValidationError) ErrorName ¶
func (e LoginRedirectDataValidationError) ErrorName() string
ErrorName returns error name.
func (LoginRedirectDataValidationError) Field ¶
func (e LoginRedirectDataValidationError) Field() string
Field function returns field value.
func (LoginRedirectDataValidationError) Key ¶
func (e LoginRedirectDataValidationError) Key() bool
Key function returns key value.
func (LoginRedirectDataValidationError) Reason ¶
func (e LoginRedirectDataValidationError) Reason() string
Reason function returns reason value.
type LoginRedirectReply ¶
type LoginRedirectReply struct {
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // 状态码
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // 消息内容
Data *LoginRedirectData `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // 响应数据
// contains filtered or unexported fields
}
LoginRedirectReply OAuth登录响应
func (*LoginRedirectReply) Descriptor
deprecated
func (*LoginRedirectReply) Descriptor() ([]byte, []int)
Deprecated: Use LoginRedirectReply.ProtoReflect.Descriptor instead.
func (*LoginRedirectReply) GetCode ¶
func (x *LoginRedirectReply) GetCode() int32
func (*LoginRedirectReply) GetData ¶
func (x *LoginRedirectReply) GetData() *LoginRedirectData
func (*LoginRedirectReply) GetMessage ¶
func (x *LoginRedirectReply) GetMessage() string
func (*LoginRedirectReply) ProtoMessage ¶
func (*LoginRedirectReply) ProtoMessage()
func (*LoginRedirectReply) ProtoReflect ¶
func (x *LoginRedirectReply) ProtoReflect() protoreflect.Message
func (*LoginRedirectReply) Reset ¶
func (x *LoginRedirectReply) Reset()
func (*LoginRedirectReply) String ¶
func (x *LoginRedirectReply) String() string
func (*LoginRedirectReply) Validate ¶
func (m *LoginRedirectReply) Validate() error
Validate checks the field values on LoginRedirectReply 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 (*LoginRedirectReply) ValidateAll ¶
func (m *LoginRedirectReply) ValidateAll() error
ValidateAll checks the field values on LoginRedirectReply 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 LoginRedirectReplyMultiError, or nil if none found.
type LoginRedirectReplyMultiError ¶
type LoginRedirectReplyMultiError []error
LoginRedirectReplyMultiError is an error wrapping multiple validation errors returned by LoginRedirectReply.ValidateAll() if the designated constraints aren't met.
func (LoginRedirectReplyMultiError) AllErrors ¶
func (m LoginRedirectReplyMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (LoginRedirectReplyMultiError) Error ¶
func (m LoginRedirectReplyMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type LoginRedirectReplyValidationError ¶
type LoginRedirectReplyValidationError struct {
// contains filtered or unexported fields
}
LoginRedirectReplyValidationError is the validation error returned by LoginRedirectReply.Validate if the designated constraints aren't met.
func (LoginRedirectReplyValidationError) Cause ¶
func (e LoginRedirectReplyValidationError) Cause() error
Cause function returns cause value.
func (LoginRedirectReplyValidationError) Error ¶
func (e LoginRedirectReplyValidationError) Error() string
Error satisfies the builtin error interface
func (LoginRedirectReplyValidationError) ErrorName ¶
func (e LoginRedirectReplyValidationError) ErrorName() string
ErrorName returns error name.
func (LoginRedirectReplyValidationError) Field ¶
func (e LoginRedirectReplyValidationError) Field() string
Field function returns field value.
func (LoginRedirectReplyValidationError) Key ¶
func (e LoginRedirectReplyValidationError) Key() bool
Key function returns key value.
func (LoginRedirectReplyValidationError) Reason ¶
func (e LoginRedirectReplyValidationError) Reason() string
Reason function returns reason value.
type LoginTokenData ¶
type LoginTokenData struct {
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` // JWT访问令牌
// contains filtered or unexported fields
}
LoginTokenData 登录令牌数据
func (*LoginTokenData) Descriptor
deprecated
func (*LoginTokenData) Descriptor() ([]byte, []int)
Deprecated: Use LoginTokenData.ProtoReflect.Descriptor instead.
func (*LoginTokenData) GetToken ¶
func (x *LoginTokenData) GetToken() string
func (*LoginTokenData) ProtoMessage ¶
func (*LoginTokenData) ProtoMessage()
func (*LoginTokenData) ProtoReflect ¶
func (x *LoginTokenData) ProtoReflect() protoreflect.Message
func (*LoginTokenData) Reset ¶
func (x *LoginTokenData) Reset()
func (*LoginTokenData) String ¶
func (x *LoginTokenData) String() string
func (*LoginTokenData) Validate ¶
func (m *LoginTokenData) Validate() error
Validate checks the field values on LoginTokenData 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 (*LoginTokenData) ValidateAll ¶
func (m *LoginTokenData) ValidateAll() error
ValidateAll checks the field values on LoginTokenData 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 LoginTokenDataMultiError, or nil if none found.
type LoginTokenDataMultiError ¶
type LoginTokenDataMultiError []error
LoginTokenDataMultiError is an error wrapping multiple validation errors returned by LoginTokenData.ValidateAll() if the designated constraints aren't met.
func (LoginTokenDataMultiError) AllErrors ¶
func (m LoginTokenDataMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (LoginTokenDataMultiError) Error ¶
func (m LoginTokenDataMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type LoginTokenDataValidationError ¶
type LoginTokenDataValidationError struct {
// contains filtered or unexported fields
}
LoginTokenDataValidationError is the validation error returned by LoginTokenData.Validate if the designated constraints aren't met.
func (LoginTokenDataValidationError) Cause ¶
func (e LoginTokenDataValidationError) Cause() error
Cause function returns cause value.
func (LoginTokenDataValidationError) Error ¶
func (e LoginTokenDataValidationError) Error() string
Error satisfies the builtin error interface
func (LoginTokenDataValidationError) ErrorName ¶
func (e LoginTokenDataValidationError) ErrorName() string
ErrorName returns error name.
func (LoginTokenDataValidationError) Field ¶
func (e LoginTokenDataValidationError) Field() string
Field function returns field value.
func (LoginTokenDataValidationError) Key ¶
func (e LoginTokenDataValidationError) Key() bool
Key function returns key value.
func (LoginTokenDataValidationError) Reason ¶
func (e LoginTokenDataValidationError) Reason() string
Reason function returns reason value.
type LoginTokenReply ¶
type LoginTokenReply struct {
Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` // 状态码
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // 消息内容
Data *LoginTokenData `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // 响应数据
// contains filtered or unexported fields
}
LoginTokenReply OAuth登录获取令牌响应
func (*LoginTokenReply) Descriptor
deprecated
func (*LoginTokenReply) Descriptor() ([]byte, []int)
Deprecated: Use LoginTokenReply.ProtoReflect.Descriptor instead.
func (*LoginTokenReply) GetCode ¶
func (x *LoginTokenReply) GetCode() int32
func (*LoginTokenReply) GetData ¶
func (x *LoginTokenReply) GetData() *LoginTokenData
func (*LoginTokenReply) GetMessage ¶
func (x *LoginTokenReply) GetMessage() string
func (*LoginTokenReply) ProtoMessage ¶
func (*LoginTokenReply) ProtoMessage()
func (*LoginTokenReply) ProtoReflect ¶
func (x *LoginTokenReply) ProtoReflect() protoreflect.Message
func (*LoginTokenReply) Reset ¶
func (x *LoginTokenReply) Reset()
func (*LoginTokenReply) String ¶
func (x *LoginTokenReply) String() string
func (*LoginTokenReply) Validate ¶
func (m *LoginTokenReply) Validate() error
Validate checks the field values on LoginTokenReply 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 (*LoginTokenReply) ValidateAll ¶
func (m *LoginTokenReply) ValidateAll() error
ValidateAll checks the field values on LoginTokenReply 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 LoginTokenReplyMultiError, or nil if none found.
type LoginTokenReplyMultiError ¶
type LoginTokenReplyMultiError []error
LoginTokenReplyMultiError is an error wrapping multiple validation errors returned by LoginTokenReply.ValidateAll() if the designated constraints aren't met.
func (LoginTokenReplyMultiError) AllErrors ¶
func (m LoginTokenReplyMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (LoginTokenReplyMultiError) Error ¶
func (m LoginTokenReplyMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type LoginTokenReplyValidationError ¶
type LoginTokenReplyValidationError struct {
// contains filtered or unexported fields
}
LoginTokenReplyValidationError is the validation error returned by LoginTokenReply.Validate if the designated constraints aren't met.
func (LoginTokenReplyValidationError) Cause ¶
func (e LoginTokenReplyValidationError) Cause() error
Cause function returns cause value.
func (LoginTokenReplyValidationError) Error ¶
func (e LoginTokenReplyValidationError) Error() string
Error satisfies the builtin error interface
func (LoginTokenReplyValidationError) ErrorName ¶
func (e LoginTokenReplyValidationError) ErrorName() string
ErrorName returns error name.
func (LoginTokenReplyValidationError) Field ¶
func (e LoginTokenReplyValidationError) Field() string
Field function returns field value.
func (LoginTokenReplyValidationError) Key ¶
func (e LoginTokenReplyValidationError) Key() bool
Key function returns key value.
func (LoginTokenReplyValidationError) Reason ¶
func (e LoginTokenReplyValidationError) Reason() string
Reason function returns reason value.
type OAuthClient ¶
type OAuthClient interface {
// OAuth登录 - 获取OAuth提供商的授权URL
OAuthLogin(ctx context.Context, in *OAuthLoginRequest, opts ...grpc.CallOption) (*LoginRedirectReply, error)
// OAuth登录获取令牌 - 处理OAuth回调并返回JWT token
OAuthLoginGetToken(ctx context.Context, in *OAuthLoginGetTokenRequest, opts ...grpc.CallOption) (*LoginTokenReply, error)
// Apple登录回调处理
AppleLoginCallback(ctx context.Context, in *AppleLoginCallbackRequest, opts ...grpc.CallOption) (*CallbackReply, error)
}
OAuthClient is the client API for OAuth 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.
OAuth认证服务
func NewOAuthClient ¶
func NewOAuthClient(cc grpc.ClientConnInterface) OAuthClient
type OAuthHTTPClient ¶
type OAuthHTTPClient interface {
// AppleLoginCallback Apple登录回调处理
AppleLoginCallback(ctx context.Context, req *AppleLoginCallbackRequest, opts ...http.CallOption) (rsp *CallbackReply, err error)
// OAuthLogin OAuth登录 - 获取OAuth提供商的授权URL
OAuthLogin(ctx context.Context, req *OAuthLoginRequest, opts ...http.CallOption) (rsp *LoginRedirectReply, err error)
// OAuthLoginGetToken OAuth登录获取令牌 - 处理OAuth回调并返回JWT token
OAuthLoginGetToken(ctx context.Context, req *OAuthLoginGetTokenRequest, opts ...http.CallOption) (rsp *LoginTokenReply, err error)
}
func NewOAuthHTTPClient ¶
func NewOAuthHTTPClient(client *http.Client) OAuthHTTPClient
type OAuthHTTPClientImpl ¶
type OAuthHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*OAuthHTTPClientImpl) AppleLoginCallback ¶
func (c *OAuthHTTPClientImpl) AppleLoginCallback(ctx context.Context, in *AppleLoginCallbackRequest, opts ...http.CallOption) (*CallbackReply, error)
AppleLoginCallback Apple登录回调处理
func (*OAuthHTTPClientImpl) OAuthLogin ¶
func (c *OAuthHTTPClientImpl) OAuthLogin(ctx context.Context, in *OAuthLoginRequest, opts ...http.CallOption) (*LoginRedirectReply, error)
OAuthLogin OAuth登录 - 获取OAuth提供商的授权URL
func (*OAuthHTTPClientImpl) OAuthLoginGetToken ¶
func (c *OAuthHTTPClientImpl) OAuthLoginGetToken(ctx context.Context, in *OAuthLoginGetTokenRequest, opts ...http.CallOption) (*LoginTokenReply, error)
OAuthLoginGetToken OAuth登录获取令牌 - 处理OAuth回调并返回JWT token
type OAuthHTTPServer ¶
type OAuthHTTPServer interface {
// AppleLoginCallback Apple登录回调处理
AppleLoginCallback(context.Context, *AppleLoginCallbackRequest) (*CallbackReply, error)
// OAuthLogin OAuth登录 - 获取OAuth提供商的授权URL
OAuthLogin(context.Context, *OAuthLoginRequest) (*LoginRedirectReply, error)
// OAuthLoginGetToken OAuth登录获取令牌 - 处理OAuth回调并返回JWT token
OAuthLoginGetToken(context.Context, *OAuthLoginGetTokenRequest) (*LoginTokenReply, error)
}
type OAuthLoginGetTokenRequest ¶
type OAuthLoginGetTokenRequest struct {
Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` // OAuth提供商: google, apple, telegram
Callback string `protobuf:"bytes,2,opt,name=callback,proto3" json:"callback,omitempty"` // OAuth回调数据(JSON格式)
Ip string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"` // 客户端IP
UserAgent string `protobuf:"bytes,4,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` // 用户代理
// contains filtered or unexported fields
}
OAuth登录获取令牌请求
func (*OAuthLoginGetTokenRequest) Descriptor
deprecated
func (*OAuthLoginGetTokenRequest) Descriptor() ([]byte, []int)
Deprecated: Use OAuthLoginGetTokenRequest.ProtoReflect.Descriptor instead.
func (*OAuthLoginGetTokenRequest) GetCallback ¶
func (x *OAuthLoginGetTokenRequest) GetCallback() string
func (*OAuthLoginGetTokenRequest) GetIp ¶
func (x *OAuthLoginGetTokenRequest) GetIp() string
func (*OAuthLoginGetTokenRequest) GetMethod ¶
func (x *OAuthLoginGetTokenRequest) GetMethod() string
func (*OAuthLoginGetTokenRequest) GetUserAgent ¶
func (x *OAuthLoginGetTokenRequest) GetUserAgent() string
func (*OAuthLoginGetTokenRequest) ProtoMessage ¶
func (*OAuthLoginGetTokenRequest) ProtoMessage()
func (*OAuthLoginGetTokenRequest) ProtoReflect ¶
func (x *OAuthLoginGetTokenRequest) ProtoReflect() protoreflect.Message
func (*OAuthLoginGetTokenRequest) Reset ¶
func (x *OAuthLoginGetTokenRequest) Reset()
func (*OAuthLoginGetTokenRequest) String ¶
func (x *OAuthLoginGetTokenRequest) String() string
func (*OAuthLoginGetTokenRequest) Validate ¶
func (m *OAuthLoginGetTokenRequest) Validate() error
Validate checks the field values on OAuthLoginGetTokenRequest 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 (*OAuthLoginGetTokenRequest) ValidateAll ¶
func (m *OAuthLoginGetTokenRequest) ValidateAll() error
ValidateAll checks the field values on OAuthLoginGetTokenRequest 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 OAuthLoginGetTokenRequestMultiError, or nil if none found.
type OAuthLoginGetTokenRequestMultiError ¶
type OAuthLoginGetTokenRequestMultiError []error
OAuthLoginGetTokenRequestMultiError is an error wrapping multiple validation errors returned by OAuthLoginGetTokenRequest.ValidateAll() if the designated constraints aren't met.
func (OAuthLoginGetTokenRequestMultiError) AllErrors ¶
func (m OAuthLoginGetTokenRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (OAuthLoginGetTokenRequestMultiError) Error ¶
func (m OAuthLoginGetTokenRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type OAuthLoginGetTokenRequestValidationError ¶
type OAuthLoginGetTokenRequestValidationError struct {
// contains filtered or unexported fields
}
OAuthLoginGetTokenRequestValidationError is the validation error returned by OAuthLoginGetTokenRequest.Validate if the designated constraints aren't met.
func (OAuthLoginGetTokenRequestValidationError) Cause ¶
func (e OAuthLoginGetTokenRequestValidationError) Cause() error
Cause function returns cause value.
func (OAuthLoginGetTokenRequestValidationError) Error ¶
func (e OAuthLoginGetTokenRequestValidationError) Error() string
Error satisfies the builtin error interface
func (OAuthLoginGetTokenRequestValidationError) ErrorName ¶
func (e OAuthLoginGetTokenRequestValidationError) ErrorName() string
ErrorName returns error name.
func (OAuthLoginGetTokenRequestValidationError) Field ¶
func (e OAuthLoginGetTokenRequestValidationError) Field() string
Field function returns field value.
func (OAuthLoginGetTokenRequestValidationError) Key ¶
func (e OAuthLoginGetTokenRequestValidationError) Key() bool
Key function returns key value.
func (OAuthLoginGetTokenRequestValidationError) Reason ¶
func (e OAuthLoginGetTokenRequestValidationError) Reason() string
Reason function returns reason value.
type OAuthLoginRequest ¶
type OAuthLoginRequest struct {
Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` // OAuth提供商: google, apple, telegram, github, facebook
Redirect string `protobuf:"bytes,2,opt,name=redirect,proto3" json:"redirect,omitempty"` // 登录成功后的重定向URL
// contains filtered or unexported fields
}
OAuth登录请求
func (*OAuthLoginRequest) Descriptor
deprecated
func (*OAuthLoginRequest) Descriptor() ([]byte, []int)
Deprecated: Use OAuthLoginRequest.ProtoReflect.Descriptor instead.
func (*OAuthLoginRequest) GetMethod ¶
func (x *OAuthLoginRequest) GetMethod() string
func (*OAuthLoginRequest) GetRedirect ¶
func (x *OAuthLoginRequest) GetRedirect() string
func (*OAuthLoginRequest) ProtoMessage ¶
func (*OAuthLoginRequest) ProtoMessage()
func (*OAuthLoginRequest) ProtoReflect ¶
func (x *OAuthLoginRequest) ProtoReflect() protoreflect.Message
func (*OAuthLoginRequest) Reset ¶
func (x *OAuthLoginRequest) Reset()
func (*OAuthLoginRequest) String ¶
func (x *OAuthLoginRequest) String() string
func (*OAuthLoginRequest) Validate ¶
func (m *OAuthLoginRequest) Validate() error
Validate checks the field values on OAuthLoginRequest 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 (*OAuthLoginRequest) ValidateAll ¶
func (m *OAuthLoginRequest) ValidateAll() error
ValidateAll checks the field values on OAuthLoginRequest 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 OAuthLoginRequestMultiError, or nil if none found.
type OAuthLoginRequestMultiError ¶
type OAuthLoginRequestMultiError []error
OAuthLoginRequestMultiError is an error wrapping multiple validation errors returned by OAuthLoginRequest.ValidateAll() if the designated constraints aren't met.
func (OAuthLoginRequestMultiError) AllErrors ¶
func (m OAuthLoginRequestMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (OAuthLoginRequestMultiError) Error ¶
func (m OAuthLoginRequestMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type OAuthLoginRequestValidationError ¶
type OAuthLoginRequestValidationError struct {
// contains filtered or unexported fields
}
OAuthLoginRequestValidationError is the validation error returned by OAuthLoginRequest.Validate if the designated constraints aren't met.
func (OAuthLoginRequestValidationError) Cause ¶
func (e OAuthLoginRequestValidationError) Cause() error
Cause function returns cause value.
func (OAuthLoginRequestValidationError) Error ¶
func (e OAuthLoginRequestValidationError) Error() string
Error satisfies the builtin error interface
func (OAuthLoginRequestValidationError) ErrorName ¶
func (e OAuthLoginRequestValidationError) ErrorName() string
ErrorName returns error name.
func (OAuthLoginRequestValidationError) Field ¶
func (e OAuthLoginRequestValidationError) Field() string
Field function returns field value.
func (OAuthLoginRequestValidationError) Key ¶
func (e OAuthLoginRequestValidationError) Key() bool
Key function returns key value.
func (OAuthLoginRequestValidationError) Reason ¶
func (e OAuthLoginRequestValidationError) Reason() string
Reason function returns reason value.
type OAuthServer ¶
type OAuthServer interface {
// OAuth登录 - 获取OAuth提供商的授权URL
OAuthLogin(context.Context, *OAuthLoginRequest) (*LoginRedirectReply, error)
// OAuth登录获取令牌 - 处理OAuth回调并返回JWT token
OAuthLoginGetToken(context.Context, *OAuthLoginGetTokenRequest) (*LoginTokenReply, error)
// Apple登录回调处理
AppleLoginCallback(context.Context, *AppleLoginCallbackRequest) (*CallbackReply, error)
// contains filtered or unexported methods
}
OAuthServer is the server API for OAuth service. All implementations must embed UnimplementedOAuthServer for forward compatibility.
OAuth认证服务
type UnimplementedOAuthServer ¶
type UnimplementedOAuthServer struct{}
UnimplementedOAuthServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedOAuthServer) AppleLoginCallback ¶
func (UnimplementedOAuthServer) AppleLoginCallback(context.Context, *AppleLoginCallbackRequest) (*CallbackReply, error)
func (UnimplementedOAuthServer) OAuthLogin ¶
func (UnimplementedOAuthServer) OAuthLogin(context.Context, *OAuthLoginRequest) (*LoginRedirectReply, error)
func (UnimplementedOAuthServer) OAuthLoginGetToken ¶
func (UnimplementedOAuthServer) OAuthLoginGetToken(context.Context, *OAuthLoginGetTokenRequest) (*LoginTokenReply, error)
type UnsafeOAuthServer ¶
type UnsafeOAuthServer interface {
// contains filtered or unexported methods
}
UnsafeOAuthServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to OAuthServer will result in compilation errors.