Example #1
0
func main() {

	var configFile string
	flag.StringVar(&configFile, "configFile", "bouncer.json", "Configuration File")
	flag.Parse()

	config, err := os.Open(configFile)

	log.Println("Starting Web Bouncer Daemon")
	if err == nil {
		decoder := json.NewDecoder(config)
		var configuration engine.Configuration
		decoder.Decode(&configuration)
		engine.Start(&configuration)
	} else {
		panic(err)
	}
}
Example #2
0
func main() {

	c := make(chan string, 1)
	go func () { fmt.Println("Got %s from the channel", <- c) }()
	c <- "foobar"


	var configFile string
	flag.StringVar(&configFile, "configFile", "bouncer.json", "Configuration File")
	flag.Parse()

	config, err := os.Open(configFile)

	log.Println("Starting Web Bouncer Daemon")
	if err == nil {
		decoder := json.NewDecoder(config)
		var configuration engine.Configuration
		decoder.Decode(&configuration)
		engine.Start(&configuration)
	} else {
		panic(err)
	}
}