conf

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 5, 2022 License: Apache-2.0 Imports: 7 Imported by: 14

Documentation

Index

Constants

View Source
const (
	AuthCodeCacheKey  = "gs:auth:code:"
	AuthTokenCacheKey = "gs:auth:token:"
)
View Source
const (
	AuthCodeCacheKeyTimeout         = time.Minute * 2     // code 过期时间
	AuthRefreshTokenCacheKeyTimeout = time.Hour * 24 * 30 // RefreshToken 过期时间
	AuthAccessTokenCacheKeyTimeout  = time.Hour * 24      // AccessToken 过期时间
)

Variables

This section is empty.

Functions

func NewLoggerCfg

func NewLoggerCfg(v *viper.Viper) (conf *log.Options, err error)

func NewMongoConfig

func NewMongoConfig(v *viper.Viper) (conf *mongo.Config, err error)

func NewRedisConfig

func NewRedisConfig(v *viper.Viper) (conf *redis.Config, err error)

func NewViper

func NewViper() (*viper.Viper, error)

Types

type AppConfig

type AppConfig struct {
	NetConf *NetConf `yaml:"netConf"`
}

func NewAppConfigCfg

func NewAppConfigCfg(v *viper.Viper) (conf *AppConfig, err error)

type NetConf

type NetConf struct {
	Name         string `yaml:"name"`         // 服务名称
	ServerAddr   string `yaml:"serverAddr"`   // 服务地址
	ReadTimeout  int    `yaml:"readTimeout"`  // 单位s
	WriteTimeout int    `yaml:"writeTimeout"` // 单位s
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL