Version: v0.0.0-...-75d2a66 Latest Latest

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

Go to latest
Published: Nov 27, 2015 License: Apache-2.0 Imports: 17 Imported by: 0




View Source
const (
	Local   string = "local"
	Dev     string = "dev"
	Product string = "product"

********************profile start************************


This section is empty.


func CloseDb

func CloseDb()

func ConfPath

func ConfPath() *string

func CurrPath

func CurrPath() string

********************db end************************ * prj path

func DbUrl

func DbUrl(dbConf DbConf) (string, string)

********************db start************************

func LoadOsFileStr

func LoadOsFileStr(name string) ([]byte, error)

func LoadWebRootFileStr

func LoadWebRootFileStr(path, name string) ([]byte, error)

func LocalAddr

func LocalAddr() string

* LocalAddr

func OpenDb

func OpenDb(dbConf DbConf) *xorm.Engine

func Port

func Port() *string

func PublicAddr

func PublicAddr() string

* Addr in internet

func SaveConf

func SaveConf(path *string, conf *Conf) error

func SaveDefaultConf

func SaveDefaultConf(conf *Conf)

func SaveOsFile

func SaveOsFile(name string, data []byte) error

func SaveWebRootFile

func SaveWebRootFile(d, name string, data []byte) error

func VersionCompare

func VersionCompare(version1 string, version2 string) (int, error)

********************version start************************ * if >0 version1 > version2 if <0 version1 < version2 if =0 version1 = version2


type Conf

type Conf struct {
	Db      DbConf `json:"db"`
	IP      string `json:"server_ip"`
	Port    string `json:"port"`
	CdnUrl  string `json:"cdn_url"`
	Profile string `json:"profile"`

func LoadConf

func LoadConf(path *string) *Conf

func LoadDefaultConf

func LoadDefaultConf() *Conf

func Start

func Start() (server *gin.Engine, db *xorm.Engine, conf *Conf)

type DbConf

type DbConf struct {
	Type         string `json:"type"`
	User         string `json:"user"`
	Pwd          string `json:"pwd"`
	Address      string `json:"address"`
	Database     string `json:"database"`
	ShowSql      bool   `json:"show_sql"`
	MaxIdleConns int    `json:"maxIdleConns"`
	MaxOpenConns int    `json:"maxOpenConns"`

Source Files

Jump to

Keyboard shortcuts

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