config

package
v0.0.0-...-ae74d76 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlidayuConfig

type AlidayuConfig struct {
	AppKey       string `toml:"app_key"`
	AppSecret    string `toml:"app_secret"`
	SignName     string `toml:"sign_name"`
	TemplateCode string `toml:"template_code"`
}

AlidayuConfig 短信配置

type DbConfig

type DbConfig struct {
	Debug   bool   `toml:"debug"`
	DbType  string `toml:"db_type"`
	Address string `toml:"address"`
	Port    int    `toml:"port"`
	User    string `toml:"user"`
	Passwd  string `toml:"passwd"`
	DbName  string `toml:"db_name"`
	Prefix  string `toml:"prefix"`
	MaxIdle int    `toml:"max_idle"`
	MaxConn int    `toml:"max_conn"`
}

DbConfig 数据库配置

type Duration

type Duration time.Duration

Duration 自定持续时间

func (Duration) MarshalText

func (d Duration) MarshalText() ([]byte, error)

MarshalText 转码为字符串

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(data []byte) error

UnmarshalText 解析字符串到定时

type HTTPListenerConfig

type HTTPListenerConfig struct {
	Enable  bool     `toml:"enable"`
	Address string   `toml:"address"`
	Port    int      `toml:"port"`
	Timeout Duration `toml:"timeout"`
}

HTTPListenerConfig http监听配置

type InfluxdbConfig

type InfluxdbConfig struct {
	Address   string   `toml:"address"`
	Port      int      `toml:"port"`
	DbName    string   `toml:"db_name"`
	SubDbName string   `toml:"sub_db_name"`
	Username  string   `toml:"username"`
	Password  string   `toml:"password"`
	Timeout   Duration `toml:"timeout"`
	MaxIdle   int      `toml:"max_idle"`
}

InfluxdbConfig influxdb配置文件

type LoggerConfig

type LoggerConfig struct {
	Name      string `toml:"name"`
	Verbose   bool   `toml:"verbose"`
	SystemLog bool   `toml:"system_log"`
}

LoggerConfig 日志记录对象配置

type NsqConfig

type NsqConfig struct {
	Address string `toml:"address"`
	Port    int    `toml:"port"`
}

NsqConfig nsq消息队列配置

type RedisConfig

type RedisConfig struct {
	Address string   `toml:"address"`
	Port    int      `toml:"port"`
	Ping    Duration `toml:"ping"`
	MaxIdle int      `toml:"max_idle"`
}

RedisConfig redis配置

type SMTPConfig

type SMTPConfig struct {
	Address  string `toml:"address"`
	Port     int    `toml:"port"`
	Username string `toml:"username"`
	Password string `toml:"password"`
	From     string `toml:"from"`
	Cc       string `toml:"cc"`
}

SMTPConfig 短信发送配置

type ServerConfig

type ServerConfig struct {
	Debug  bool                `toml:"debug"`
	Logger *LoggerConfig       `toml:"logger"`
	HTTP   *HTTPListenerConfig `toml:"http"`
	NSQ    *NsqConfig          `toml:"nsq"`
	Redis  *RedisConfig        `toml:"redis"`
}

ServerConfig server配置

func NewServerConfig

func NewServerConfig(path string) (*ServerConfig, error)

NewServerConfig 实例化server配置

type TCPListenerConfig

type TCPListenerConfig struct {
	Enable  bool     `toml:"enable"`
	Address string   `toml:"address"`
	Port    int      `toml:"port"`
	Timeout Duration `toml:"timeout"`
}

TCPListenerConfig http监听配置

type WechatConfig

type WechatConfig struct {
	AppID         string `toml:"app_id"`
	AppSecret     string `toml:"app_secret"`
	EncodedAesKey string `toml:"encoded_aes_key"`
	Token         string `toml:"token"`
	TemplateID    string `toml:"template_id"`
	ServerURL     string `toml:"server_url"`
}

WechatConfig 微信配置

Jump to

Keyboard shortcuts

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