Documentation
¶
Overview ¶
Package kvs provides a session storage backend using kvs.ListableStore.
This adapter allows any kvs.ListableStore (Redis, SQLite, etc.) to be used as a session storage backend.
Index ¶
- func NewWithControls(backend kvs.ListableStore, cfg session.Config, opts ...session.ControlOption) session.Store
- type Store
- func (s *Store) Close() error
- func (s *Store) Create(ctx context.Context, sess *session.Session) error
- func (s *Store) Delete(ctx context.Context, id string) error
- func (s *Store) DeleteByUserID(ctx context.Context, userID string) (int, error)
- func (s *Store) Get(ctx context.Context, id string) (*session.Session, error)
- func (s *Store) ListByUserID(ctx context.Context, userID string) ([]*session.Session, error)
- func (s *Store) Touch(ctx context.Context, id string) error
- func (s *Store) Update(ctx context.Context, sess *session.Session) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWithControls ¶
func NewWithControls(backend kvs.ListableStore, cfg session.Config, opts ...session.ControlOption) session.Store
NewWithControls creates a new KVS-backed session store with controls. This is a convenience function that wraps New() with WithControls().
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements session.Store using a kvs.ListableStore backend.
func New ¶
func New(backend kvs.ListableStore, cfg session.Config) *Store
New creates a new KVS-backed session store.
func (*Store) DeleteByUserID ¶
DeleteByUserID removes all sessions for a user.
func (*Store) ListByUserID ¶
ListByUserID returns all sessions for a user, sorted by CreatedAt ascending (oldest first).
Click to show internal directories.
Click to hide internal directories.