Documentation ¶
Overview ¶
Package boxes is a wrapper around a set of go.rice boxes created by a go.rice Config defined to first look for files in the package directory, and then in the binary.
Index ¶
- func Assets() *rice.Box
- func ConnectToMySQL(config *Config)
- func ConnectToRedis(config *Config)
- func FindById(id int64, bean interface{}) interface{}
- func GetAppConfBytes() []byte
- func GetLogConfBytes() []byte
- func GetRedisClient() *redis.Client
- func GetXormEngine() *xorm.Engine
- func Insert(bean interface{}) (int64, error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectToMySQL ¶
func ConnectToMySQL(config *Config)
func ConnectToRedis ¶
func ConnectToRedis(config *Config)
func GetAppConfBytes ¶
func GetAppConfBytes() []byte
func GetLogConfBytes ¶
func GetLogConfBytes() []byte
func GetRedisClient ¶
func GetRedisClient() *redis.Client
func GetXormEngine ¶
Types ¶
type Config ¶
type Config struct { ServerConf struct { Port uint16 `yaml:"port"` } `yaml:"server"` MySQLConf struct { Driver string `yaml:"driver"` DataSource string `yaml:"dataSource"` MaxIdleConns int `yaml:"maxIdleConns"` MaxOpenConns int `yaml:"maxOpenConns"` } `yaml:"mysql"` RedisConf struct { Address string `yaml:"address"` Password string `yaml:"password"` } `yaml:"redis"` }
func LoadConfig ¶
func LoadConfig() *Config
Click to show internal directories.
Click to hide internal directories.