rename session manager functions
This commit is contained in:
@@ -23,18 +23,22 @@ const (
|
|||||||
InMemory StoreType = iota
|
InMemory StoreType = iota
|
||||||
)
|
)
|
||||||
|
|
||||||
func CreateSessionManager(storeType StoreType) *SessionManager {
|
func GetSessionManager() *SessionManager {
|
||||||
once.Do(func() {
|
once.Do(func() {
|
||||||
instance = &SessionManager{}
|
instance = &SessionManager{}
|
||||||
|
})
|
||||||
|
return instance
|
||||||
|
}
|
||||||
|
|
||||||
|
func (manager *SessionManager) SetStoreType(storeType StoreType) {
|
||||||
|
logging.Infof("Changing session manager store type")
|
||||||
switch storeType {
|
switch storeType {
|
||||||
case InMemory:
|
case InMemory:
|
||||||
{
|
{
|
||||||
instance.store = NewMemoryStore()
|
manager.store = NewMemoryStore()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
return instance
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (manager *SessionManager) CreateSession(userID string) (cookie *http.Cookie, err error) {
|
func (manager *SessionManager) CreateSession(userID string) (cookie *http.Cookie, err error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user