Documentation
¶
Index ¶
- func GenerateSid(id *int64, key string) string
- func GenerateToken(id int64, expire int, signKey []byte) (string, error)
- type AnyParam
- type AuthController
- type Claims
- type Ctx
- func (m *Ctx) AnyMultiParam(p string) (ap *AnyParam)
- func (m *Ctx) AnyPostParam(p string) (ap *AnyParam)
- func (m *Ctx) AnyUriParam(p string) (ap *AnyParam)
- func (m *Ctx) Error(err string) error
- func (m *Ctx) File(p string) *multipart.FileHeader
- func (m *Ctx) Header(p string) string
- func (m *Ctx) Html(str string) error
- func (m *Ctx) MultiParam(p string) string
- func (m *Ctx) PostParam(p string) string
- func (m *Ctx) Redirect(uri string)
- func (m *Ctx) RenderJson(data any) *Msg
- func (m *Ctx) SetHeader(k, v string)
- func (m *Ctx) SetStatusCode(c int)
- func (m *Ctx) Success(msg string) error
- func (m *Ctx) Text(str string) error
- func (m *Ctx) UriParam(p string) string
- func (m *Ctx) WithCtx(ctx *fasthttp.RequestCtx) *Ctx
- type EmptyController
- type IMember
- type JwtController
- type Msg
- type SidController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSid ¶
Types ¶
type AnyParam ¶
type AnyParam struct {
// contains filtered or unexported fields
}
func (*AnyParam) MustFloat64 ¶ added in v1.0.20
type AuthController ¶ added in v1.0.24
type AuthController struct { Ctx CheckAuth func(ctx *fasthttp.RequestCtx) bool BeforeReq func(ctx *fasthttp.RequestCtx) bool // contains filtered or unexported fields }
func (*AuthController) Auth ¶ added in v1.0.24
func (m *AuthController) Auth(ctx *fasthttp.RequestCtx, name, action string) bool
Auth 所有控制层的鉴权方法 返回 true 表示成功
func (*AuthController) SetSkipRule ¶ added in v1.0.24
func (m *AuthController) SetSkipRule(r *[][]string)
type Ctx ¶
type Ctx struct {
// contains filtered or unexported fields
}
func (*Ctx) AnyMultiParam ¶ added in v1.0.22
AnyMultiParam get arg with content-type: multipart/form-data
func (*Ctx) AnyPostParam ¶ added in v1.0.21
AnyPostParam get arg with content-type: application/x-www-form-urlencoded
func (*Ctx) AnyUriParam ¶ added in v1.0.21
AnyUriParam get an arg from query uri
func (*Ctx) MultiParam ¶ added in v1.0.22
MultiParam get arg with content-type: multipart/form-data
func (*Ctx) PostParam ¶ added in v1.0.21
PostParam get arg with content-type: application/x-www-form-urlencoded
func (*Ctx) RenderJson ¶
func (*Ctx) SetStatusCode ¶
type EmptyController ¶ added in v1.0.20
type EmptyController struct {
Ctx
}
EmptyController do nothing
type JwtController ¶
type JwtController struct { Ctx AuthOk func(id *int64) bool // contains filtered or unexported fields }
func (*JwtController) Auth ¶
func (m *JwtController) Auth(ctx *fasthttp.RequestCtx, name, action string) bool
Auth 所有控制层的鉴权方法 返回 true 表示成功
func (*JwtController) InitJwt ¶
func (m *JwtController) InitJwt(signKey []byte)
func (*JwtController) SetSkipRule ¶
func (m *JwtController) SetSkipRule(r *[][]string)
type Msg ¶
type SidController ¶
type SidController struct { AuthController CheckAuth func(sid *string, ctx *fasthttp.RequestCtx) bool }
func (*SidController) Auth ¶
func (m *SidController) Auth(ctx *fasthttp.RequestCtx, name, action string) bool
Auth 所有控制层的鉴权方法 返回 true 表示成功
Click to show internal directories.
Click to hide internal directories.