Documentation ¶
Index ¶
- Constants
- func BearerAuthenticationMiddleware(db *bun.DB) func(c *fiber.Ctx) error
- func CreateAccessToken(ctx context.Context, user *model.User) (string, error)
- func DeleteExpiredAccessTokens(ctx context.Context, user *model.User) error
- func GenerateUrlSafeSecureRandomString(n int) (string, error)
- func GetUserByAccessToken(ctx context.Context, token string) (*model.User, error)
- func GetUserByEmail(ctx context.Context, email string) (*model.User, error)
- func HashPrivilege(user *model.User, operationType OperationType, resourceId string, ...) bool
- type ApplicationContext
- type OperationType
- type PrincipalType
- type ResourceType
Constants ¶
View Source
const ( OperationTypeAdd OperationType = "add" OperationTypeGet = "get" OperationTypeUpdate = "update" OperationTypeRemove = "remove" )
Variables ¶
This section is empty.
Functions ¶
func CreateAccessToken ¶
func GetUserByAccessToken ¶
func HashPrivilege ¶
Types ¶
type OperationType ¶
type OperationType string
type PrincipalType ¶
type PrincipalType string
const ( PrincipalTypeUser PrincipalType = "user" PrincipalTypeGroup = "group" )
type ResourceType ¶
type ResourceType string
const ( ResourceTypeUser ResourceType = "user" ResourceTypeGroup ResourceType = "group" )
Click to show internal directories.
Click to hide internal directories.