Documentation ¶
Index ¶
- Variables
- func AdminGuard(app *core.App, handler fiber.Handler) fiber.Handler
- func CheckIsAdminReq(app *core.App, c *fiber.Ctx) bool
- func CheckSiteExist(app *core.App, c *fiber.Ctx, siteName string) (entity.CookedSite, bool, error)
- func ErrorHandler(ctx *fiber.Ctx, err error) error
- func GetJwtDataByReq(app *core.App, c *fiber.Ctx) (jwtCustomClaims, error)
- func GetLimiter(c *fiber.Ctx) (lmt *limiter.Limiter, err error)
- func GetTokenByReq(c *fiber.Ctx) string
- func GetUserByReq(app *core.App, c *fiber.Ctx) (entity.User, error)
- func LimiterGuard(app *core.App, handler fiber.Handler) fiber.Handler
- func LogWithHttpInfo(c *fiber.Ctx, logFn func(l *zap.SugaredLogger))
- func LoginGetUserToken(user entity.User, key string, ttl int) (string, error)
- func LoginGuard(app *core.App, handler func(*fiber.Ctx, entity.User) error) fiber.Handler
- func NewCaptchaChecker(app *core.App, c *fiber.Ctx) captcha.Checker
- func ParamsDecode(c *fiber.Ctx, destParams interface{}) (isContinue bool, resp error)
- func RespData(c *fiber.Ctx, data interface{}) error
- func RespError(c *fiber.Ctx, code int, msg string, data ...Map) error
- func RespSuccess(c *fiber.Ctx, msg ...string) error
- func ValidateRequired(c *fiber.Ctx, destParams interface{}) (isContinue bool, resp error)
- type ApiVersionData
- type ConfData
- type JSONResult
- type Map
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTokenInvalidFromDate = fmt.Errorf("token is invalid starting from a certain date")
View Source
var ErrTokenNotProvided = fmt.Errorf("token not provided")
View Source
var ErrTokenUserNotFound = fmt.Errorf("user not found")
Functions ¶
func AdminGuard ¶
func CheckIsAdminReq ¶
func CheckSiteExist ¶
func ErrorHandler ¶
func GetJwtDataByReq ¶
func GetLimiter ¶
func GetTokenByReq ¶
func GetTokenByReq(c *fiber.Ctx) string
func LimiterGuard ¶
func LogWithHttpInfo ¶
func LogWithHttpInfo(c *fiber.Ctx, logFn func(l *zap.SugaredLogger))
func LoginGetUserToken ¶
func LoginGuard ¶
func ParamsDecode ¶
func RespSuccess ¶
RespSuccess is just response success
func ValidateRequired ¶
Types ¶
type ApiVersionData ¶
type ApiVersionData struct { App string `json:"app"` Version string `json:"version"` CommitHash string `json:"commit_hash"` }
func GetApiVersionDataMap ¶
func GetApiVersionDataMap() ApiVersionData
type ConfData ¶
type ConfData struct { FrontendConf Map `json:"frontend_conf"` Version ApiVersionData `json:"version"` }
func GetApiPublicConfDataMap ¶
type JSONResult ¶
type JSONResult struct { Msg string `json:"msg,omitempty"` // Message Data interface{} `json:"data,omitempty"` // Data }
JSONResult JSON Response data structure
Source Files ¶
Click to show internal directories.
Click to hide internal directories.