Example #1
0
File: init.go Project: zhgo/solr
func init() {
	var c conf

	// Load config file
	replaces := map[string]string{"{WorkingDir}": config.WorkingDir()}
	config.NewConfig("zhgo.json").Replace(replaces).Parse(c)

	pool = c.Solr
}
Example #2
0
File: main.go Project: liudng/app
func main() {
	// New http application
	app := biz.HttpApp{}

	// Load config file
	replaces := map[string]string{"{WorkingDir}": config.WorkingDir()}
	config.NewConfig("soe-http.json").Replace(replaces).Parse(&app)

	// Start http server.
	app.Load()
	app.LoadMuxList()
	app.Start()

	// Start tcp server.
	// TODO

	// Start jobs.
	// TODO
}
Example #3
0
package main

import (
	"fmt"
	"github.com/zhgo/config"
	"github.com/zhgo/db"
	"log"
	"math/rand"
	"os"
	"path/filepath"
	"time"
)

var WorkingDir string = config.WorkingDir()

type Migration struct {
	db            *db.Server
	rows          []map[string]interface{}
	fsql          *os.File
	DSN           string `json:"dsn"`
	Module        string `json:"module"`
	TableName     string `json:"table_name"`
	Primary       string `json:"primary"`
	SrcColumn     string `json:"src_column"`
	SrcPathPrefix string `json:"src_path_prefix"`
	DstBktColumn  string `json:"dst_bkt_column"`
	DstBktValue   string `json:"dst_bkt_value"`
	DstKeyColumn  string `json:"dst_key_column"`
	NfsSrcDir     string `json:"nfs_src_dir"`
	MigAdpDir     string `json:"mig_adp_dir"`
}