MCPcopy Create free account
hub / github.com/devfeel/dotweb / GetSessionStore

Function GetSessionStore

session/session.go:57–71  ·  view source on GitHub ↗

GetSessionStore create new session store with store config

(config *StoreConfig)

Source from the content-addressed store, hash-verified

55
56// GetSessionStore create new session store with store config
57func GetSessionStore(config *StoreConfig) SessionStore {
58 switch config.StoreName {
59 case SessionMode_Runtime:
60 return NewRuntimeStore(config)
61 case SessionMode_Redis:
62 store, err := NewRedisStore(config)
63 if err != nil {
64 panic(fmt.Sprintf("redis session [%v] ping error -> %v", config.StoreName, err.Error()))
65 } else {
66 return store
67 }
68 default:
69 panic("not support session store -> " + config.StoreName)
70 }
71}
72
73// NewDefaultRuntimeConfig create new store with default config and use runtime store
74func NewDefaultRuntimeConfig() *StoreConfig {

Callers 1

NewSessionManagerFunction · 0.85

Calls 3

NewRuntimeStoreFunction · 0.85
NewRedisStoreFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected