MCPcopy Create free account
hub / github.com/koding/kite / New

Function New

kontrol/kontrol.go:140–153  ·  view source on GitHub ↗

New creates a new kontrol instance with the given version and config instance, and the default kontrol handlers. Publickey is used for validating tokens and privateKey is used for signing tokens. Public and private keys are RSA pem blocks that can be generated with the following command: openssl g

(conf *config.Config, version string)

Source from the content-addressed store, hash-verified

138// NewWithoutHandlers(conf, version)
139//
140func New(conf *config.Config, version string) *Kontrol {
141 kontrol := NewWithoutHandlers(conf, version)
142
143 kontrol.Kite.HandleFunc("register", kontrol.HandleRegister)
144 kontrol.Kite.HandleFunc("registerMachine", kontrol.HandleMachine).DisableAuthentication()
145 kontrol.Kite.HandleFunc("getKites", kontrol.HandleGetKites)
146 kontrol.Kite.HandleFunc("getToken", kontrol.HandleGetToken)
147 kontrol.Kite.HandleFunc("getKey", kontrol.HandleGetKey)
148
149 kontrol.Kite.HandleHTTPFunc("/register", kontrol.HandleRegisterHTTP)
150 kontrol.Kite.HandleHTTPFunc("/heartbeat", kontrol.HandleHeartbeat)
151
152 return kontrol
153}
154
155// NewWithoutHandlers creates a new kontrol instance with the given version and config
156// instance, but *without* the default handlers. If this is function is

Callers 1

startKontrolFunction · 0.70

Calls 4

NewWithoutHandlersFunction · 0.85
HandleFuncMethod · 0.80
DisableAuthenticationMethod · 0.80
HandleHTTPFuncMethod · 0.80

Tested by 1

startKontrolFunction · 0.56