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