Documentation ¶
Index ¶
- func CleanUp(db *gorm.DB, interval time.Duration, close chan bool)
- func GetCreateSession(ctx context.Context) func(token string, age int)
- func GetDestroySession(ctx context.Context) func()
- func GetDevice(ctx context.Context) *model.Device
- func GetUser(ctx context.Context) *model.User
- func HasRole() ...
- func Middleware(db *gorm.DB) mux.MiddlewareFunc
- func WithCreateSession(ctx context.Context, f func(token string, age int)) context.Context
- func WithDestroySession(ctx context.Context, f func()) context.Context
- func WithDevice(ctx context.Context, device *model.Device) context.Context
- func WithUser(ctx context.Context, user *model.User) context.Context
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCreateSession ¶
GetCreateSession gets the create session callback
func GetDestroySession ¶
GetDestroySession gets the destroy session callback
func HasRole ¶
func HasRole() func(ctx context.Context, obj interface{}, next graphql.Resolver, role gqlmodel.Role) (res interface{}, err error)
HasRole checks if the current user has sufficient permissions.
func Middleware ¶
func Middleware(db *gorm.DB) mux.MiddlewareFunc
Middleware is the auth middleware which sets user and device context parameters.
func WithCreateSession ¶
WithCreateSession adds the create session method
func WithDestroySession ¶
WithDestroySession adds the destroy session method
func WithDevice ¶
WithDevice adds the authenticated device to the context.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.