Exemple #1
0
func main() {
	flag.Parse()

	if *devMode {
		ast.EnableDeveloperFunctions()
		if *logKeys == "" {
			clog.ParseLogFlags(devModeDefaultLogKeys)
			clog.Log("Developer Mode Enabled (default developer logging)")
		} else {
			clog.ParseLogFlag(*logKeys)
			clog.Log("Developer Mode Enabled (custom command-line logging)")
		}
	}

	if *profileMode {
		clog.Log("Enabling HTTP Profiling on :6060")
		go func() {
			realhttp.ListenAndServe(":6060", nil)
		}()
	}

	go dumpOnSignalForPlatform()

	// create a QueryChannel
	queryChannel := make(network.QueryChannel)

	// create one or more network endpoints
	httpEndpoint := http.NewHttpEndpoint(*addr, *staticPath)
	httpEndpoint.SendQueriesTo(queryChannel)

	err := server.Server(VERSION, *couchbaseSite, *defaultPoolName, queryChannel, queryTimeout)
	if err != nil {
		clog.Fatalf("Unable to run server, err: %v", err)
	}
}
Exemple #2
0
func Start(site, pool string) network.QueryChannel {
	timeout := -1 * time.Second
	qc := make(network.QueryChannel)
	go server.Server("TEST", site, pool, qc, &timeout)
	return qc
}