2024-07-12 20:32:33 +08:00
|
|
|
package corelib
|
|
|
|
|
|
|
|
import (
|
|
|
|
"gopkg.in/boj/redistore.v1"
|
|
|
|
"picgo/configs"
|
|
|
|
)
|
|
|
|
|
|
|
|
var SessionStore *redistore.RediStore
|
|
|
|
|
|
|
|
func NewSessionStore() {
|
|
|
|
// Fetch new store.
|
2024-07-12 20:36:13 +08:00
|
|
|
store, err := redistore.NewRediStore(10, "tcp", configs.Settings.Redis.Addr, configs.Settings.Redis.Password)
|
2024-07-12 20:32:33 +08:00
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
SessionStore = store
|
|
|
|
defer store.Close()
|
|
|
|
}
|