示例#1
0
func runServer() {
	observer := rules.NewObserver(knf.GetS(DATA_RULE_DIR))
	observer.AutoHead = knf.GetB(PROCESSING_AUTO_HEAD)
	observer.Start(knf.GetI(DATA_CHECK_DELAY))

	err := server.Start(observer, APP+"/"+VER, arg.GetS(ARG_PORT))

	if err != nil {
		printError(err.Error())
		os.Exit(1)
	}
}
示例#2
0
func listMocks(args []string) {
	var service = ""

	// Suppress observer logging
	log.Set(os.DevNull, 0)

	if len(args) != 0 {
		service = args[0]
	}

	observer := rules.NewObserver(knf.GetS(DATA_RULE_DIR))
	err := listing.List(observer, service)

	if err != nil {
		printError(err.Error())
		os.Exit(1)
	}
}