Documentation
¶
Index ¶
- Constants
- func Module(scope string) fx.Option
- type AuthenticateRequest
- type AuthenticateRequestBody
- type AuthenticateResponse
- type CreateRequest
- type CreateRequestBody
- type CreateResponse
- type DeleteRequest
- type DeleteRequestURI
- type DeleteResponse
- type ErrorResponse
- type GetMeRequest
- type GetMeResponse
- type GetRequest
- type GetRequestURI
- type GetResponse
- type ListRequest
- type ListRequestQuery
- type ListResponse
- type Params
- type UpdateMeRequest
- type UpdateMeRequestBody
- type UpdateMeResponse
- type UpdateMyPasswordRequest
- type UpdateMyPasswordRequestBody
- type UpdateMyPasswordResponse
- type UpdatePasswordRequest
- type UpdatePasswordRequestBody
- type UpdatePasswordRequestURI
- type UpdatePasswordResponse
- type UpdateRequest
- type UpdateRequestBody
- type UpdateRequestURI
- type UpdateResponse
- type UserAPIs
- type UserEntry
Constants ¶
View Source
const ModuleName = "UserAPIs"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthenticateRequest ¶
type AuthenticateRequest struct {
Body AuthenticateRequestBody
}
type AuthenticateRequestBody ¶
type AuthenticateResponse ¶
type AuthenticateResponse struct {
Success bool `json:"success"`
Message string `json:"message"`
User *UserEntry `json:"user,omitempty"`
}
AuthenticateResponse authenticate response
type CreateRequest ¶
type CreateRequest struct {
Body CreateRequestBody
}
type CreateRequestBody ¶
type CreateRequestBody struct {
Username string `json:"username" binding:"required,min=3,max=255"`
Email string `json:"email" binding:"required,email"`
Password string `json:"password" binding:"required,min=8"`
DisplayName string `json:"display_name"`
Roles []string `json:"roles"` // Multiple roles
Status string `json:"status" binding:"omitempty,oneof=active inactive suspended"`
}
type CreateResponse ¶
CreateResponse create response
type DeleteRequest ¶
type DeleteRequest struct {
URI DeleteRequestURI
}
type DeleteRequestURI ¶
type DeleteRequestURI struct {
ID string `uri:"id" binding:"required"`
}
type DeleteResponse ¶
type DeleteResponse struct {
Message string `json:"message"`
}
DeleteResponse delete response
type ErrorResponse ¶ added in v0.0.2
type ErrorResponse struct {
Error string `json:"error" example:"error message"`
}
ErrorResponse error response
type GetMeRequest ¶ added in v0.0.2
type GetMeRequest struct{}
type GetMeResponse ¶ added in v0.0.2
type GetMeResponse struct {
User *UserEntry `json:"user"`
}
GetMeResponse self-service get me response
type GetRequest ¶
type GetRequest struct {
URI GetRequestURI
}
type GetRequestURI ¶
type GetRequestURI struct {
ID string `uri:"id" binding:"required"`
}
type GetResponse ¶
type GetResponse struct {
User *UserEntry `json:"user"`
}
GetResponse get response
type ListRequest ¶
type ListRequest struct {
Query ListRequestQuery
}
type ListRequestQuery ¶
type ListResponse ¶
type ListResponse struct {
Total int64 `json:"total"`
Page int `json:"page"`
PageSize int `json:"page_size"`
TotalPages int `json:"total_pages"`
OrderBy []string `json:"order_by"`
Order int `json:"order"`
Keywords string `json:"keywords,omitempty"`
Users []*UserEntry `json:"users"`
}
ListResponse list response
type Params ¶
type Params struct {
weedbox.Params
HTTPServer *http_server.HTTPServer
User *user.UserManager `name:"user"`
Auth *auth.AuthManager `name:"auth"`
}
type UpdateMeRequest ¶ added in v0.0.2
type UpdateMeRequest struct {
Body UpdateMeRequestBody
}
type UpdateMeRequestBody ¶ added in v0.0.2
type UpdateMeResponse ¶ added in v0.0.2
UpdateMeResponse self-service update me response
type UpdateMyPasswordRequest ¶ added in v0.0.2
type UpdateMyPasswordRequest struct {
Body UpdateMyPasswordRequestBody
}
type UpdateMyPasswordRequestBody ¶ added in v0.0.2
type UpdateMyPasswordResponse ¶ added in v0.0.2
type UpdateMyPasswordResponse struct {
Message string `json:"message"`
}
UpdateMyPasswordResponse self-service update my password response
type UpdatePasswordRequest ¶
type UpdatePasswordRequest struct {
URI UpdatePasswordRequestURI
Body UpdatePasswordRequestBody
}
type UpdatePasswordRequestBody ¶
type UpdatePasswordRequestBody struct {
NewPassword string `json:"new_password" binding:"required,min=8"`
}
type UpdatePasswordRequestURI ¶
type UpdatePasswordRequestURI struct {
ID string `uri:"id" binding:"required"`
}
type UpdatePasswordResponse ¶
type UpdatePasswordResponse struct {
Message string `json:"message"`
}
UpdatePasswordResponse update password response (admin reset)
type UpdateRequest ¶
type UpdateRequest struct {
URI UpdateRequestURI
Body UpdateRequestBody
}
type UpdateRequestBody ¶
type UpdateRequestBody struct {
Username string `json:"username" binding:"omitempty,min=3,max=255"`
Email string `json:"email" binding:"omitempty,email"`
DisplayName string `json:"display_name"`
Roles []string `json:"roles"` // Multiple roles
Status string `json:"status" binding:"omitempty,oneof=active inactive suspended"`
}
type UpdateRequestURI ¶
type UpdateRequestURI struct {
ID string `uri:"id" binding:"required"`
}
type UpdateResponse ¶
UpdateResponse update response
type UserAPIs ¶
func (*UserAPIs) InitDefaultConfigs ¶
func (m *UserAPIs) InitDefaultConfigs()
type UserEntry ¶
type UserEntry struct {
ID string `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
DisplayName string `json:"display_name"`
Roles []string `json:"roles"`
Status string `json:"status"`
LastLoginAt *string `json:"last_login_at,omitempty"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
UserEntry user item in API response
Click to show internal directories.
Click to hide internal directories.