MCPcopy Index your code
hub / github.com/koding/kite / init

Function init

test/kontrolclient_test.go:22–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20)
21
22func init() {
23 conf = config.New()
24 conf.Username = "testuser"
25 conf.KontrolURL = "http://localhost:4099/kite"
26 conf.KontrolKey = testkeys.Public
27 conf.KontrolUser = "testuser"
28 conf.KiteKey = testutil.NewKiteKey().Raw
29 conf.ReadEnvironmentVariables()
30
31 kontrol.DefaultPort = 4099
32 kon := kontrol.New(conf.Copy(), "0.1.0")
33
34 switch os.Getenv("KONTROL_STORAGE") {
35 case "etcd":
36 kon.SetStorage(kontrol.NewEtcd(nil, kon.Kite.Log))
37 case "postgres":
38 p := kontrol.NewPostgres(nil, kon.Kite.Log)
39 kon.SetStorage(p)
40 kon.SetKeyPairStorage(p)
41 default:
42 kon.SetStorage(kontrol.NewEtcd(nil, kon.Kite.Log))
43 }
44
45 kon.AddKeyPair("", testkeys.Public, testkeys.Private)
46
47 go kon.Run()
48 <-kon.Kite.ServerReadyNotify()
49}
50
51func TestRegisterToKontrol(t *testing.T) {
52 k := setup()

Callers

nothing calls this directly

Calls 7

CopyMethod · 0.80
SetStorageMethod · 0.80
SetKeyPairStorageMethod · 0.80
AddKeyPairMethod · 0.80
ServerReadyNotifyMethod · 0.80
RunMethod · 0.45

Tested by

no test coverage detected