Documentation ¶
Index ¶
- func Check(user models.User, ctx iris.Context)
- func CreateUser(user models.User) (token string, id uint)
- func HasRole(ctx iris.Context, role string) bool
- func Init(config Config) iris.Handler
- func IsAuth(ctx iris.Context) bool
- func MiddleAuth(ctx iris.Context)
- func MiddleRole(role string) iris.Handler
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateUser ¶ added in v0.1.13
CreateUser allow to store a user in the DB
func Init ¶ added in v0.1.10
func Init(config Config) iris.Handler
Init exports the middleware function to initialize DB if needed, and populate the ctx.User() object at each run.
func IsAuth ¶ added in v0.1.1
func IsAuth(ctx iris.Context) bool
IsAuth returns true if User has been authenticated
func MiddleAuth ¶ added in v0.1.2
func MiddleAuth(ctx iris.Context)
MiddleAuth exports the middleware function to check authentification
func MiddleRole ¶ added in v0.1.10
func MiddleRole(role string) iris.Handler
MiddleRole check if the user has the required Role
Types ¶
Click to show internal directories.
Click to hide internal directories.