2022-05-27 17:50:38 +00:00
|
|
|
package inmemory
|
|
|
|
|
2022-05-29 11:52:46 +00:00
|
|
|
import (
|
|
|
|
"sync"
|
|
|
|
)
|
2022-05-27 17:50:38 +00:00
|
|
|
|
|
|
|
type provider struct {
|
|
|
|
mutex sync.Mutex
|
|
|
|
sessionStore map[string]map[string]string
|
|
|
|
stateStore map[string]string
|
2022-05-29 11:52:46 +00:00
|
|
|
envStore *EnvStore
|
2022-05-27 17:50:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewInMemoryStore returns a new in-memory store.
|
|
|
|
func NewInMemoryProvider() (*provider, error) {
|
|
|
|
return &provider{
|
|
|
|
mutex: sync.Mutex{},
|
|
|
|
sessionStore: map[string]map[string]string{},
|
|
|
|
stateStore: map[string]string{},
|
2022-05-29 11:52:46 +00:00
|
|
|
envStore: &EnvStore{
|
|
|
|
mutex: sync.Mutex{},
|
|
|
|
store: map[string]interface{}{},
|
|
|
|
},
|
2022-05-27 17:50:38 +00:00
|
|
|
}, nil
|
|
|
|
}
|