Documentation
¶
Index ¶
- Constants
- type Dialect
- type Opts
- type SqlKV
- func (k *SqlKV) CreateTable(ctx context.Context) error
- func (k *SqlKV) Delete(ctx context.Context, key string) error
- func (k *SqlKV) GC(ctx context.Context) (deleted int, _ error)
- func (k *SqlKV) Get(ctx context.Context, key string) (_ []byte, found bool, _ error)
- func (k *SqlKV) RunGC(ctx context.Context, interval time.Duration, logger *slog.Logger)
- func (k *SqlKV) Set(ctx context.Context, key string, expiresAt time.Time, value []byte) error
Constants ¶
View Source
const (
// DefaultTableName is the default table name for the KV store
DefaultTableName = "web_sessions"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Opts ¶
type Opts struct {
// TableName is the name of the table to use for the KV store (defaults to "web_sessions")
TableName string
// Dialect specifies which SQL dialect to use (defaults to Generic)
Dialect Dialect
}
Opts contains options for configuring the KV store
type SqlKV ¶
type SqlKV struct {
// contains filtered or unexported fields
}
SqlKV implements the session.SqlKV interface using database/sql
func (*SqlKV) CreateTable ¶
CreateTable creates the sessions table if it doesn't exist
Click to show internal directories.
Click to hide internal directories.