Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryDatabaseParams ¶
type SessionStorage ¶
type SessionStorage interface { // AddSession adds a new session to the storage. AddSession(ctx context.Context, session *model.Session) (err error) // GetSession retrieves a session from the storage using the JWT ID. GetSession(ctx context.Context, jwtID string) (session *model.Session, err error) // ReplaceSession replaces an old session with a new session in the storage. ReplaceSession(ctx context.Context, oldSession *model.Session, session *model.Session) (err error) // DeleteSession deletes a session from the storage. DeleteSession(ctx context.Context, jwtID string) (err error) }
SessionStorage is an interface that declares methods for session management in a database.
func NewInMemoryDatabase ¶
func NewInMemoryDatabase(params *InMemoryDatabaseParams) SessionStorage
func NewRedisDatabase ¶
func NewRedisDatabase(logger *zap.SugaredLogger, redis *redis.Client) SessionStorage
NewRedisDatabase is a constructor for sessionstorage.
Click to show internal directories.
Click to hide internal directories.