Documentation
¶
Index ¶
- func Delete(c *fiber.Ctx, key string)
- func Destroy(c *fiber.Ctx)
- func Get[T any](c *fiber.Ctx, key string) (T, bool)
- func GetID(c *fiber.Ctx) string
- func GetInt(c *fiber.Ctx, key string) int64
- func GetIntOnce(c *fiber.Ctx, key string) int64
- func GetOnce[T any](c *fiber.Ctx, key string) (T, bool)
- func GetOnceOrDefault[T any](c *fiber.Ctx, key string) T
- func GetOrDefault[T any](c *fiber.Ctx, key string) T
- func GetString(c *fiber.Ctx, key string) string
- func GetStringOnce(c *fiber.Ctx, key string) string
- func GetUint(c *fiber.Ctx, key string) uint64
- func GetUintOnce(c *fiber.Ctx, key string) uint64
- func Init(sessionConfig *Config, dsn string)
- func Set[T any](c *fiber.Ctx, key string, value T)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Get ¶
Get fetches a value from the session and casts it to T, returning the value and a boolean indicating whether the value was present in the session.
func GetInt ¶
GetInt fetches an int64 from the session, returning 0 if it isn't found. If you need to be able to differentiate between absence and 0, use Get.
func GetIntOnce ¶
GetIntOnce fetches an int64 from the session and then deletes it from the session. If you need to be able to differentiate between absence and 0, use GetOnce.
func GetOnce ¶
GetOnce fetches a value from the session and casts it to T, then deletes it from the session.
func GetOnceOrDefault ¶
GetOnceOrDefault fetches a value from the session and casts it to T, returning the value or the default value for the type if it was not present in the session.
func GetOrDefault ¶
GetOrDefault fetches a value from the session and casts it to T, returning the value or the default value for the type if it was not present in the session.
func GetString ¶
GetString fetches a string from the session, returning the empty string if it isn't found. If you need to be able to differentiate between absence and the empty string, use Get.
func GetStringOnce ¶
GetStringOnce fetches a string from the session and then deletes it from the session. If you need to be able to differentiate between absence and the empty string, use GetOnce.
func GetUint ¶
GetUint fetches a uint64 from the session, returning 0 if it isn't found. If you need to be able to differentiate between absence and 0, use Get.
func GetUintOnce ¶
GetUintOnce fetches an int64 from the session and then deletes it from the session. If you need to be able to differentiate between absence and 0, use GetOnce.