Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeviceIdParse ¶
func DeviceIdParse(c *fiber.Ctx) string
DeviceIdParser represents the device ID parser.
func NewDeviceId ¶
func NewDeviceId(cnf DeviceIdConfig) fiber.Handler
NewDeviceId creates a new device ID middleware.
Types ¶
type Config ¶
type Config struct { // Service is the sudo service. Service sudo.Service // UserParser is the function used to parse the current user. UserParser CurrentUserParser // LocaleParser is the function used to parse the locale. LocaleParser LocaleParser // AccessKey is the name of the header used to store the access key. AccessKey string // VerifyKey is the name of the header used to store the verify key. VerifyKey string // CodeKey is the name of the header used to store the code. CodeKey string }
Config holds the configuration for the sudo middleware.
type CurrentUser ¶
type CurrentUser struct { // TwoFactorEnabled indicates whether the two-factor authentication is enabled for the user. TwoFactorEnabled bool // UUID is the unique identifier of the user. UUID string // Phone is the phone number of the user. Phone string // Email is the email of the user. Email string }
CurrentUser represents the current user.
type CurrentUserParser ¶
type CurrentUserParser func(ctx *fiber.Ctx) CurrentUser
CurrentUserParser represents the current user parser.
type DeviceIdConfig ¶
type DeviceIdConfig struct { // CookieName is the name of the cookie used to store the device ID. CookieName string }
DeviceIdConfig holds the configuration for the device ID middleware.
type LocaleParser ¶
type LocaleParser func(ctx *fiber.Ctx) string
LocaleConfig holds the configuration for the locale middleware.
Click to show internal directories.
Click to hide internal directories.