Documentation ¶
Index ¶
- func Check(user models.User, ctx iris.Context) bool
- func CreateUser(user models.User) (token string, id uuid.UUID)
- 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 ¶
CreateUser allow to store a user in the DB
func Init ¶
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 MiddleAuth ¶
func MiddleAuth(ctx iris.Context)
MiddleAuth exports the middleware function to check authentification
func MiddleRole ¶
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.