mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-12 06:28:50 +00:00
some work on auth/sessions
This commit is contained in:
@@ -3,16 +3,19 @@ package config
|
||||
import (
|
||||
"github.com/Sirupsen/logrus"
|
||||
"github.com/spf13/viper"
|
||||
"time"
|
||||
)
|
||||
|
||||
var Cfg struct {
|
||||
ServerAddr string
|
||||
DbConnStr string
|
||||
WebHookSecret []byte
|
||||
WebHookHash string
|
||||
WebHookSigHeader string
|
||||
LogLevel logrus.Level
|
||||
DbLogLevels []logrus.Level
|
||||
ServerAddr string
|
||||
DbConnStr string
|
||||
WebHookSecret []byte
|
||||
WebHookHash string
|
||||
WebHookSigHeader string
|
||||
LogLevel logrus.Level
|
||||
DbLogLevels []logrus.Level
|
||||
SessionCookieName string
|
||||
SessionCookieExpiration time.Duration
|
||||
}
|
||||
|
||||
func SetupConfig() {
|
||||
@@ -35,4 +38,7 @@ func SetupConfig() {
|
||||
newLevel, _ := logrus.ParseLevel(level)
|
||||
Cfg.DbLogLevels = append(Cfg.DbLogLevels, newLevel)
|
||||
}
|
||||
Cfg.SessionCookieName = viper.GetString("session.cookie_name")
|
||||
Cfg.SessionCookieExpiration, err = time.ParseDuration(viper.GetString("session.expiration"))
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user