app

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2017 License: MIT Imports: 6 Imported by: 1

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assets

func Assets() *rice.Box

func ConnectToMySQL

func ConnectToMySQL(config *Config)

func ConnectToRedis

func ConnectToRedis(config *Config)

func FindById

func FindById(id int64, bean interface{}) interface{}

func GetAppConfBytes

func GetAppConfBytes() []byte

func GetLogConfBytes

func GetLogConfBytes() []byte

func GetRedisClient

func GetRedisClient() *redis.Client

func GetXormEngine

func GetXormEngine() *xorm.Engine

func Insert

func Insert(bean interface{}) (int64, error)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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