示例#1
0
// manually configure and start internals
func mistInitialize() error {
	var err error
	drain.CleanFreq = 1
	config.LogKeep = `{"app": "1s", "deploy":0}`
	config.LogKeep = `{"app": "1s", "deploy":0, "a":"1m", "aa":"1h", "b":"1d", "c":"1w", "d":"1y", "e":"1"}`
	config.Log = lumber.NewConsoleLogger(lumber.LvlInt("ERROR"))
	config.DbAddress = "boltdb:///tmp/boltdbTest/logvac.bolt"

	server.StartTCP(PubAddress, nil)

	// initialize logvac
	logvac.Init()

	// initialize publisher
	// Doing broke publisher
	config.PubAddress = "~!@#$%^&*()"
	drain.Init()
	drain.Archiver.(*drain.BoltArchive).Close()

	// Doing schemeless publisher
	config.PubAddress = "127.0.0.1:2445"
	drain.Init()
	drain.Archiver.(*drain.BoltArchive).Close()
	drain.Publisher.(*drain.Mist).Close()

	// Doing real publisher
	config.PubAddress = "mist://127.0.0.1:2445"
	err = drain.Init()

	return err
}
示例#2
0
// TestMain
func TestMain(m *testing.M) {
	lumber.Level(lumber.LvlInt("fatal"))

	server.StartTCP(testAddr, nil)

	//
	os.Exit(m.Run())
}