package
0.0.0-20250123075806-8eab22a6f65e
Repository: https://github.com/mbetel/core.git
Documentation: pkg.go.dev
# Functions
NewSqlxStore creates a new [SqlxStore] that can be used to retrieve and save user sessions from a database.
NewSqlxStoreFromDsn creates a new [SqlxStore] that can be used to retrieve and save user sessions from a database, it uses a dsn string to create a connection to the database.
WithCleanupInterval returns a [SqlxStoreOption] that allows to enable and set the cleanup interval, the cleanup interval is the time between each scan to remove expired sessions from the database.
WithDomain returns a [SqlxStoreOption] that allows to change the domain parameter of the session cookie that is provided by default when creating a new session.
WithHttpOnly returns a [SqlxStoreOption] that allows to change the httpOnly parameter of the session cookie that is provided by default when creating a new session.
WithMaxAge returns a [SqlxStoreOption] that allows to change the maxAge parameter of the session cookie that is provided by default when creating a new session MaxAge=0 means no Max-Age attribute specified and the cookie will be deleted after the browser session ends.
WithPartitioned returns a [SqlxStoreOption] that allows to enable or disable the Partitioned attribute in a cookie.
WithPath returns a [SqlxStoreOption] that allows to change the path parameter of the session cookie that is provided by default when creating a new session.
WithSameSite returns a [SqlxStoreOption] that allows to change the sameSite parameter of the session cookie that is provided by default when creating a new session.
WithSecure returns a [SqlxStoreOption] that allows to change the secure parameter of the session cookie that is provided by default when creating a new session.
# Variables
Error definitions.
Error definitions.
Error definitions.
Error definitions.
Error definitions.
Error definitions.
Error definitions.
Error definitions.
Error definitions.
Error definitions.
Error definitions.
Error definitions.
Error definitions.
Error definitions.
Error definitions.
Error definitions.
Error definitions.
Error definitions.
# Structs
KeyPair rappresent two keys, an AuthenticationKey used for signing and an optional (can be nil) EncryptionKey for encryption.
MySqlStoreError provides a custom wrapper for encapsulating the function name with an error.
SqlxStore provides session data from a mysql database.
# Type aliases
SqlxStoreOption A list of SqlxStoreOption can be used when creating a SqlxStore when using [NewSqlxStore] or [NewSqlxStoreFromDsn].