Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Module = fx.Options( fx.Provide(NewAccountController), fx.Provide(NewAuthController), fx.Provide(NewSystemController), fx.Provide(NewWebsiteController), )
Module exports controller module.
Functions ¶
This section is empty.
Types ¶
type AccountController ¶
type AccountController struct {
// contains filtered or unexported fields
}
AccountController data type.
func NewAccountController ¶
func NewAccountController(httpService service.HTTPService) AccountController
NewAccountController creates a new AccountController.
func (AccountController) GetCurrentAccount ¶
func (c AccountController) GetCurrentAccount(ctx *gin.Context)
GetCurrentAccount gets authenticated account. swagger:operation GET /account Account currentUser
Get current authenticated user.
--- Security: - OAuth2PasswordBearer: []
responses:
200: description: Ok schema: $ref: "#/definitions/UserAccount" 401: description: Access Denied schema: $ref: "#/definitions/HTTPError"
type AuthController ¶
type AuthController struct {
// contains filtered or unexported fields
}
AuthController data type.
func NewAuthController ¶
func NewAuthController( httpService service.HTTPService, authService service.JWTAuthService, userService service.UserService, ) AuthController
NewAuthController creates a new AuthController.
func (AuthController) Register ¶
func (c AuthController) Register(ctx *gin.Context)
Register creates a new user. swagger:operation POST /auth/register Auth register
Register new user.
--- parameters:
- name: body in: body description: register payload required: true schema: $ref: "#/definitions/UserRegister"
responses:
201: description: Created schema: $ref: "#/definitions/UserAccount" 400: description: Bad Request schema: $ref: "#/definitions/HTTPError"
func (AuthController) Token ¶
func (c AuthController) Token(ctx *gin.Context)
Token creates the oauth token. swagger:operation POST /auth/token Auth token
Authenticate User.
--- parameters:
- name: grant_type in: formData description: Grant Type type: string
- name: username in: formData description: Username required: true type: string
- name: password in: formData description: Password required: true type: string
- name: scope in: formData description: Scope type: string
- name: client_id in: formData description: Client ID type: string
- name: client_secret in: formData description: Client Secret type: string
Consumes: - application/x-www-form-urlencoded
responses:
200: description: Ok schema: $ref: "#/definitions/OAuthResponse" 400: description: Bad Request schema: $ref: "#/definitions/OAuthError" 401: description: Unauthorized schema: $ref: "#/definitions/OAuthError"
type SystemController ¶
type SystemController struct {
// contains filtered or unexported fields
}
SystemController data type.
func NewSystemController ¶
func NewSystemController( httpService service.HTTPService, websiteService service.WebsiteService, userService service.UserService, ) SystemController
NewSystemController creates a new SystemController.
func (SystemController) Websites ¶
func (c SystemController) Websites(ctx *gin.Context)
Websites returns the list of websites with tokens. @todo: Add Swagger docs.
type WebsiteController ¶
type WebsiteController struct {
// contains filtered or unexported fields
}
WebsiteController data type.
func NewWebsiteController ¶
func NewWebsiteController( httpService service.HTTPService, websiteService service.WebsiteService, ) WebsiteController
NewWebsiteController creates a new WebsiteController.
func (WebsiteController) All ¶
func (c WebsiteController) All(ctx *gin.Context)
All gets model.Website entities for current user. swagger:operation GET /website Website getAll
Get user websites.
--- Security: - OAuth2PasswordBearer: []
responses:
200: description: Ok schema: $ref: "#/definitions/WebsitesOnResponse"
func (WebsiteController) Create ¶
func (c WebsiteController) Create(ctx *gin.Context)
Create creates new model.Website. swagger:operation POST /website Website create
Create new website.
--- parameters:
- name: body in: body description: website payload required: true schema: $ref: "#/definitions/WebsiteOnCreate"
Security: - OAuth2PasswordBearer: []
responses:
201: description: Created schema: $ref: "#/definitions/WebsiteOnResponse" 400: description: Bad Request schema: $ref: "#/definitions/HTTPError"