Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
corepkgv2
Commits
20c57641
Commit
20c57641
authored
4 years ago
by
Akshay Bharambe
Browse files
Options
Downloads
Patches
Plain Diff
Add: Init cache related func. with new Setup
parent
2d2a7434
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!210
Staging mepdeployment05072020
,
!203
Add: New cache initialization to make v2 independent of CoreSLS
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
authmdl/sessionmdl/session.go
+9
-0
authmdl/sessionmdl/session.go
sessionmanagermdl/sessionmanager.go
+9
-0
sessionmanagermdl/sessionmanager.go
with
18 additions
and
0 deletions
authmdl/sessionmdl/session.go
+
9
−
0
View file @
20c57641
...
...
@@ -52,6 +52,15 @@ func InitUserSessionCache(chacheType int) {
store
=
cachemdl
.
GetCacheInstance
(
&
cacheConfig
)
}
// Init initializes sessions with provided cache. Subsequent calls will not have any effect after fist initialization.
func
Init
(
cache
cachemdl
.
Cacher
)
{
if
store
!=
nil
{
return
}
store
=
cache
}
// Set stores the sessions for provided userId. Session is appended to the list. It does not check if the same session exists or not.
func
Set
(
userId
string
,
s
...
Session
)
{
i
,
ok
:=
store
.
Get
(
userId
)
...
...
This diff is collapsed.
Click to expand it.
sessionmanagermdl/sessionmanager.go
+
9
−
0
View file @
20c57641
...
...
@@ -49,6 +49,15 @@ func InitSessionManagerCache(chacheType int) {
store
=
cachemdl
.
GetCacheInstance
(
&
cacheConfig
)
}
// Init initializes session manager with provided cache. Subsequent calls will not have any effect after fist initialization.
func
Init
(
cache
cachemdl
.
Cacher
)
{
if
store
!=
nil
{
return
}
store
=
cache
}
// NewEntry prepares the object required to store data in session.
//
// The `exp` field interprets time in seconds. Ex. For 5 seconds, set `5`
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets