Documentation ¶
Index ¶
- type MemStore
- func (m *MemStore) Create(_ context.Context, s sessionup.Session) error
- func (m *MemStore) DeleteByID(_ context.Context, id string) error
- func (m *MemStore) DeleteByUserKey(_ context.Context, key string, expID ...string) error
- func (m *MemStore) FetchByID(_ context.Context, id string) (sessionup.Session, bool, error)
- func (m *MemStore) FetchByUserKey(_ context.Context, key string) ([]sessionup.Session, error)
- func (m *MemStore) StopCleanup()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemStore ¶
type MemStore struct {
// contains filtered or unexported fields
}
MemStore is an in-memory implementation of sessionup.Store. Since session data is being kept in memory, it will be lost once the application is closed.
func New ¶
New returns a fresh instance of MemStore. Duration parameter determines how often the cleanup function wil be called to remove the expired sessions. Setting it to 0 will prevent cleanup from being activated.
func (*MemStore) DeleteByID ¶
DeleteByID implements sessionup.Store interface's DeleteByID method.
func (*MemStore) DeleteByUserKey ¶
DeleteByUserKey implements sessionup.Store interface's DeleteByUserKey method.
func (*MemStore) FetchByUserKey ¶
FetchByUserKey implements sessionup.Store interface's FetchByUserKey method.
func (*MemStore) StopCleanup ¶
func (m *MemStore) StopCleanup()
StopCleanup terminates the automatic cleanup process. Useful for testing and cases when store is used only temporary. In order to restart the cleanup, new store must be created.