config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(ctx context.Context, pattern string, def ...interface{}) (*gvar.Var, error)

func GetBool

func GetBool(ctx context.Context, pattern string, def ...interface{}) (bool, error)

func GetInt

func GetInt(ctx context.Context, pattern string, def ...interface{}) int

func GetMapStrStr

func GetMapStrStr(ctx context.Context, pattern string, def ...interface{}) map[string]string

func GetString

func GetString(ctx context.Context, pattern string, def ...interface{}) string

Types

type App

type App struct {
	Env        string   `json:"env"`
	Debug      bool     `json:"debug"`
	JuheKey    string   `json:"juhe_key"`
	JuheUrl    string   `json:"juhe_url"`
	AdminEmail []string `json:"admin_email"`
}

type Config

type Config struct {
	AdminServerAddress string `json:"admin_server_address"`
	App                *App   `json:"app"`
	Http               *Http  `json:"http"`
	Email              *Email `json:"email"`
	Debug              bool   `json:"debug"`
}

配置信息

var Cfg *Config

type Email

type Email struct {
	Host     string `json:"host"`     // smtp.xxx.com
	Port     int    `json:"port"`     // 端口号
	UserName string `json:"username"` // 登录账号
	Password string `json:"password"` // 登录密码
	FromName string `json:"fromname"` // 发送人名称
}

邮件配置信息

type Http

type Http struct {
	Timeout  time.Duration `json:"timeout"`
	ProxyUrl string        `json:"proxy_url"`
}

Jump to

Keyboard shortcuts

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