2022-05-27 23:20:38 +05:30
|
|
|
package providers
|
|
|
|
|
|
|
|
// Provider defines current memory store provider
|
|
|
|
type Provider interface {
|
2022-08-29 08:18:20 +05:30
|
|
|
// SetUserSession sets the user session for given user identifier in form recipe:user_id
|
2022-06-11 19:10:39 +05:30
|
|
|
SetUserSession(userId, key, token string) error
|
|
|
|
// GetAllUserSessions returns all the user sessions from the session store
|
|
|
|
GetAllUserSessions(userId string) (map[string]string, error)
|
|
|
|
// GetUserSession returns the session token for given token
|
2022-06-12 00:27:21 +05:30
|
|
|
GetUserSession(userId, key string) (string, error)
|
2022-06-11 19:10:39 +05:30
|
|
|
// DeleteUserSession deletes the user session
|
2022-06-12 00:27:21 +05:30
|
|
|
DeleteUserSession(userId, key string) error
|
2022-05-27 23:20:38 +05:30
|
|
|
// DeleteAllSessions deletes all the sessions from the session store
|
2022-06-11 19:10:39 +05:30
|
|
|
DeleteAllUserSessions(userId string) error
|
2022-07-01 22:02:34 +05:30
|
|
|
// DeleteSessionForNamespace deletes the session for a given namespace
|
|
|
|
DeleteSessionForNamespace(namespace string) error
|
2022-06-11 19:10:39 +05:30
|
|
|
|
2022-05-27 23:20:38 +05:30
|
|
|
// SetState sets the login state (key, value form) in the session store
|
|
|
|
SetState(key, state string) error
|
|
|
|
// GetState returns the state from the session store
|
2022-05-29 17:22:46 +05:30
|
|
|
GetState(key string) (string, error)
|
2022-05-27 23:20:38 +05:30
|
|
|
// RemoveState removes the social login state from the session store
|
|
|
|
RemoveState(key string) error
|
2022-05-29 17:22:46 +05:30
|
|
|
|
|
|
|
// methods for env store
|
|
|
|
|
|
|
|
// UpdateEnvStore to update the whole env store object
|
|
|
|
UpdateEnvStore(store map[string]interface{}) error
|
|
|
|
// GetEnvStore() returns the env store object
|
|
|
|
GetEnvStore() (map[string]interface{}, error)
|
|
|
|
// UpdateEnvVariable to update the particular env variable
|
|
|
|
UpdateEnvVariable(key string, value interface{}) error
|
|
|
|
// GetStringStoreEnvVariable to get the string env variable from env store
|
|
|
|
GetStringStoreEnvVariable(key string) (string, error)
|
|
|
|
// GetBoolStoreEnvVariable to get the bool env variable from env store
|
|
|
|
GetBoolStoreEnvVariable(key string) (bool, error)
|
2022-05-27 23:20:38 +05:30
|
|
|
}
|