conf

package
v0.0.0-...-868a888 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path string) error

Types

type AmqpConfig

type AmqpConfig struct {
	Host     string `yaml:"host"`
	Port     int32  `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

type AppConfig

type AppConfig struct {
	Meta   *MetaConfig   `yaml:"meta"`
	MySQL  *MySQLConfig  `yaml:"mysql"`
	Redis  *RedisConfig  `yaml:"redis"`
	Amqp   *AmqpConfig   `yaml:"amqp"`
	Email  *EmailConfig  `yaml:"email"`
	Jwt    *JwtConfig    `yaml:"jwt"`
	Casbin *CasbinConfig `yaml:"casbin"`
}

func Config

func Config() *AppConfig

type CasbinConfig

type CasbinConfig struct {
	ConfigPath string `yaml:"conf-path"`
}

type EmailConfig

type EmailConfig struct {
	Name     string `yaml:"name"`
	SmtpHost string `yaml:"smtp-host"`
	SmtpPort int32  `yaml:"smtp-port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	Expire   int64  `yaml:"expire"`
}

type JwtConfig

type JwtConfig struct {
	Secret string `yaml:"secret"`
	Expire int64  `yaml:"expire"`
	Issuer string `yaml:"issuer"`
}

type MetaConfig

type MetaConfig struct {
	RunMode     string `yaml:"run-mode"`
	Port        int    `yaml:"port"`
	LogPath     string `yaml:"log-path"`
	LogName     string `yaml:"log-name"`
	LogRotate   bool   `yaml:"log-rotate"`
	LogMq       bool   `yaml:"log-mq"`
	DefPageSize int32  `yaml:"def-page-size"`
	MaxPageSize int32  `yaml:"max-page-size"`
}

type MySQLConfig

type MySQLConfig struct {
	Host        string `yaml:"host"`
	Port        int32  `yaml:"port"`
	Name        string `yaml:"name"`
	Charset     string `yaml:"charset"`
	User        string `yaml:"user"`
	Password    string `yaml:"password"`
	MaxIdle     int32  `yaml:"max-idle"`
	MaxActive   int32  `yaml:"max-active"`
	MaxLifetime int32  `yaml:"max-lifetime"`
}

type RedisConfig

type RedisConfig struct {
	Addr           string `yaml:"addr"`
	Db             int    `yaml:"db"`
	Password       string `yaml:"password"`
	ConnectTimeout int32  `yaml:"connect-timeout"`
	ReadTimeout    int32  `yaml:"read-timeout"`
	WriteTimeout   int32  `yaml:"write-timeout"`
	MaxIdle        int32  `yaml:"max-idle"`
	MaxActive      int32  `yaml:"max-active"`
	MaxLifetime    int32  `yaml:"max-lifetime"`
	IdleTimeout    int32  `yaml:"idle-timeout"`
}

Jump to

Keyboard shortcuts

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