jwt.go 261 B

12345678910111213141516171819
  1. package config
  2. import (
  3. "github.com/spf13/viper"
  4. )
  5. type Jwt struct {
  6. Secret string
  7. Timeout int64
  8. }
  9. func InitJwt(cfg *viper.Viper) *Jwt {
  10. return &Jwt{
  11. Secret: cfg.GetString("secret"),
  12. Timeout: cfg.GetInt64("timeout"),
  13. }
  14. }
  15. var JwtConfig = new(Jwt)