示例#1
0
func initConfig() {
	util.LoadConfig()
	authn.InitValidator()

	sc := make(chan os.Signal, 1)

	signal.Notify(sc, syscall.SIGHUP)

	go func() {
		for {
			<-sc
			util.LoadConfig()
		}
	}()
}
示例#2
0
文件: fox_test.go 项目: livenson/fox
	BeforeEach(func() {
		util.LoadConfigByName("test_config")
		router = NewRouter()
		recorder = httptest.NewRecorder()

		aFox = Fox{
			Name:    "Rein",
			Parents: []string{"2", "3"},
		}

		anotherFox = Fox{
			Name:    "NewName",
			Parents: []string{"4", "5"},
		}
		authn.InitValidator()
		authn.InitMint()
		token = authn.GetToken("testuser")
	})

	Describe("Adding foxes", func() {
		Context("Adding, reading and updating a fox", func() {
			// Simple adding of a fox
			It("Should return 201", func() {

				// Add the fox
				foxID := addFox(aFox, router)

				// See if we can find it
				_ = getFox(foxID, router)
			})