Documentation ¶
Index ¶
- func PromethusMetrics(router *gin.Engine, duration time.Duration, cache domain.Cache)
- func RunApi(config *domain.CommonConfig) error
- func Swagger(router *gin.Engine, schema, host, port, path_api string)
- type Controller
- func (co *Controller) CheckMailUser(ctx *gin.Context)
- func (co *Controller) DeleteFile(ctx *gin.Context)
- func (co *Controller) DownloadFile(ctx *gin.Context)
- func (co *Controller) ListFiles(ctx *gin.Context)
- func (co *Controller) LogoutUser(ctx *gin.Context)
- func (co *Controller) SignInUser(ctx *gin.Context)
- func (co *Controller) SignUpUser(ctx *gin.Context)
- func (co *Controller) UploadFile(ctx *gin.Context)
- func (co *Controller) UserWhoami(ctx *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PromethusMetrics ¶
enable metrics for length cache & metrics gin
func RunApi ¶
func RunApi(config *domain.CommonConfig) error
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(config *domain.CommonConfig) Controller
func (*Controller) CheckMailUser ¶
func (co *Controller) CheckMailUser(ctx *gin.Context)
@Summary Verify mail @Tags Users @Description Check user mail @Accept json @Produce json @Param verificationCode path string true "Verification code from mail" @Success 200 {object} oTPResponse @Failure 400 {object} response @Failure 404 {object} response @Failure 500 {object} response @Router /verifymail/{verificationCode} [get]
func (*Controller) DeleteFile ¶
func (co *Controller) DeleteFile(ctx *gin.Context)
@Summary DeleteFile @Tags Files @Description Delete file @Accept multipart/form-data @Produce json @Security ApiKeyAuth @Param Authorization header string true "token" @Param uuid path string true "file uuid" @Success 200 {object} response @Failure 400 {object} response @Failure 404 {object} response @Failure 500 {object} response @Router /delete/{uuid} [delete]
func (*Controller) DownloadFile ¶
func (co *Controller) DownloadFile(ctx *gin.Context)
@Summary DownloadFile @Tags Files @Description Download file @Accept multipart/form-data @Produce json @Security ApiKeyAuth @Param Authorization header string true "token" @Param uuid path string true "file uuid" @Success 200 {object} response @Failure 400 {object} response @Failure 404 {object} response @Failure 500 {object} response @Router /download/{uuid} [get]
func (*Controller) ListFiles ¶
func (co *Controller) ListFiles(ctx *gin.Context)
@Summary ListFiles @Tags Files @Description List all files @Accept json @Produce json @Security ApiKeyAuth @Param Authorization header string true "token" @Success 200 {object} []filesResponse @Failure 400 {object} response @Failure 404 {object} response @Failure 500 {object} response @Router /list [get]
func (*Controller) LogoutUser ¶
func (co *Controller) LogoutUser(ctx *gin.Context)
@Summary SignOut @Tags Users @Description Logout from system @Accept json @Produce json @Security ApiKeyAuth @Param Authorization header string true "token" @Success 200 {object} response @Failure 400 {object} response @Failure 404 {object} response @Failure 500 {object} response @Router /logout [get]
func (*Controller) SignInUser ¶
func (co *Controller) SignInUser(ctx *gin.Context)
SignIn @Summary SignIn @Tags Users @Description Sign in users @Accept json @Produce json @Param input body signInInput true "Sign in info" @Success 200 {object} response @Failure 400 {object} response @Failure 404 {object} response @Failure 500 {object} response @Router /signin [get]
func (*Controller) SignUpUser ¶
func (co *Controller) SignUpUser(ctx *gin.Context)
@Summary SingUp @Tags Users @Description Create user account @Accept json @Produce json @Param input body signUpInput true "Sign up info" @Success 200 {object} response @Failure 400 {object} response @Failure 404 {object} response @Failure 500 {object} response @Router /singup [get]
func (*Controller) UploadFile ¶
func (co *Controller) UploadFile(ctx *gin.Context)
@Summary UploadFile @Tags Files @Description Upload file @Accept multipart/form-data @Produce json @Security ApiKeyAuth @Param Authorization header string true "token" @Param file formData file true "this is a test file" @Success 200 {object} response @Failure 400 {object} response @Failure 404 {object} response @Failure 500 {object} response @Router /upload [post]
func (*Controller) UserWhoami ¶
func (co *Controller) UserWhoami(ctx *gin.Context)
@Summary UserWhoami @Tags Users @Description Get user info @Accept json @Produce json @Security ApiKeyAuth @Param Authorization header string true "token" @Success 200 {object} userResponse @Failure 400 {object} response @Failure 404 {object} response @Failure 500 {object} response @Router /whoami [get]