Documentation
¶
Overview ¶
Package memory provides an in-memory session storage backend.
This backend is suitable for development and testing. Data is not persisted across restarts.
Index ¶
- func NewWithControls(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) Len() int
- 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 ¶
NewWithControls creates a new in-memory 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 with in-memory storage.
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.