Documentation
¶
Index ¶
- Constants
- func Module(scope string) fx.Option
- type AuthAPIs
- type ErrorResponse
- type LoginRequest
- type LoginRequestBody
- type LoginResponse
- type LogoutRequest
- type LogoutRequestBody
- type LogoutResponse
- type Params
- type RefreshRequest
- type RefreshRequestBody
- type RefreshResponse
- type TokenResponse
- type UserInfo
Constants ¶
View Source
const ModuleName = "AuthAPIs"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthAPIs ¶
func (*AuthAPIs) InitDefaultConfigs ¶
func (m *AuthAPIs) InitDefaultConfigs()
type ErrorResponse ¶ added in v0.0.2
type ErrorResponse struct {
Error string `json:"error" example:"error message"`
}
ErrorResponse error response
type LoginRequest ¶
type LoginRequest struct {
Body LoginRequestBody
}
type LoginRequestBody ¶
type LoginResponse ¶
type LoginResponse struct {
Message string `json:"message"`
Token TokenResponse `json:"token"`
User *UserInfo `json:"user,omitempty"`
}
LoginResponse login response
type LogoutRequest ¶
type LogoutRequest struct {
Body LogoutRequestBody
}
type LogoutRequestBody ¶
type LogoutRequestBody struct {
RefreshToken string `json:"refresh_token" binding:"required"`
}
type LogoutResponse ¶
type LogoutResponse struct {
Message string `json:"message"`
}
LogoutResponse logout response
type Params ¶
type Params struct {
weedbox.Params
HTTPServer *http_server.HTTPServer
Auth *auth.AuthManager `name:"auth"`
}
type RefreshRequest ¶
type RefreshRequest struct {
Body RefreshRequestBody
}
type RefreshRequestBody ¶
type RefreshRequestBody struct {
RefreshToken string `json:"refresh_token" binding:"required"`
}
type RefreshResponse ¶
type RefreshResponse struct {
Message string `json:"message"`
Token TokenResponse `json:"token"`
}
RefreshResponse refresh response
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
TokenType string `json:"token_type"`
ExpiresIn int64 `json:"expires_in"`
ExpiresAt time.Time `json:"expires_at"`
RefreshExpiresAt time.Time `json:"refresh_expires_at"`
}
TokenResponse contains authentication tokens
Click to show internal directories.
Click to hide internal directories.