19 lines
388 B
Go
19 lines
388 B
Go
package corelib
|
|
|
|
import (
|
|
"github.com/boj/redistore"
|
|
"picgo/configs"
|
|
)
|
|
|
|
var SessionStore *redistore.RediStore
|
|
|
|
func NewSessionStore() {
|
|
// Fetch new store.
|
|
store, err := redistore.NewRediStore(10, "tcp", configs.Settings.Redis.Addr, configs.Settings.Redis.Password, []byte(configs.Settings.SessionsKey))
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
SessionStore = store
|
|
//defer store.Close()
|
|
}
|