config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeDev  = "dev"
	ModeProd = "prod"

	ProvidorFile   = "file"
	ProvidorStdOut = "stdout"

	RotateByDay  = "day"
	RotateBySize = "size"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Name string
	Mode string
	Port int

	Sess  SessionConfig
	Log   LogConfig
	Mysql MysqlConfig
	Redis RedisInstance
}

type LogConfig

type LogConfig struct {
	Name         string
	Providor     string
	LogPath      string
	RotateMode   string
	RotateLimit  string
	Suffix       string
	RotateEnable bool
}

type MysqlConfig

type MysqlConfig struct {
	Instances []MysqlInstance
	Ping      bool
}

type MysqlInstance

type MysqlInstance struct {
	Name     string `json:"name"`
	Host     string `json:"host"`
	Port     int    `json:"port"`
	User     string `json:"user"`
	Pwd      string `json:"password"`
	Db       string `json:"db"`
	ReadOnly bool   `json:"read_only"`
}

func (MysqlInstance) String

func (inst MysqlInstance) String() string

type RedisInstance

type RedisInstance struct {
	Name string `json:"name"`
	Host string `json:"host"`
	Pwd  string `json:"password"`
	Port int    `json:"port"`
	Db   int    `json:"database"`
	Ping bool   `json:"ping"`
}

func (RedisInstance) Address

func (inst RedisInstance) Address() string

type SessionConfig

type SessionConfig struct {
	Providor  string
	StorePath string
	Enable    bool
}

Jump to

Keyboard shortcuts

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