mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-06-02 17:40:14 +00:00
28 lines
638 B
Go
28 lines
638 B
Go
//go:build exclude
|
|
|
|
// temporary
|
|
|
|
// Package memory provides an in-memory implementation of repository.Store for use in tests.
|
|
package memory
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/tinyauthapp/tinyauth/internal/repository"
|
|
)
|
|
|
|
// Store is a thread-safe in-memory implementation of repository.Store.
|
|
type Store struct {
|
|
mu sync.RWMutex
|
|
sessions map[string]repository.Session
|
|
oidcSessions map[string]repository.OidcSession
|
|
}
|
|
|
|
// New returns a new empty in-memory Store.
|
|
func New() repository.Store {
|
|
return &Store{
|
|
sessions: make(map[string]repository.Session),
|
|
oidcSessions: make(map[string]repository.OidcSession),
|
|
}
|
|
}
|