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

Method GetKites

kontrolclient.go:124–139  ·  view source on GitHub ↗

GetKites returns the list of Kites matching the query. The returned list contains Ready to connect Client instances. The caller must connect with Client.Dial() before using each Kite. An error is returned when no kites are available. The returned clients have token renewer running, which is leaked

(query *protocol.KontrolQuery)

Source from the content-addressed store, hash-verified

122// return clients[0]
123//
124func (k *Kite) GetKites(query *protocol.KontrolQuery) ([]*Client, error) {
125 if err := k.SetupKontrolClient(); err != nil {
126 return nil, err
127 }
128
129 clients, err := k.getKites(protocol.GetKitesArgs{Query: query})
130 if err != nil {
131 return nil, err
132 }
133
134 if len(clients) == 0 {
135 return nil, ErrNoKitesAvailable
136 }
137
138 return clients, nil
139}
140
141// used internally for GetKites() and WatchKites()
142func (k *Kite) getKites(args protocol.GetKitesArgs) ([]*Client, error) {

Callers 12

RegisterToProxyMethod · 0.95
TestWebSocketProxyFunction · 0.80
helloMethod · 0.80
WaitTillConnectedFunction · 0.80
TestMultipleRegisterFunction · 0.80
TestMultipleFunction · 0.80
TestGetKitesFunction · 0.80
TestKontrolFunction · 0.80
TestKontrolMultiKeyFunction · 0.80
TestRegisterToKontrolFunction · 0.80
RunMethod · 0.80
mainFunction · 0.80

Calls 2

SetupKontrolClientMethod · 0.95
getKitesMethod · 0.95

Tested by 9

TestWebSocketProxyFunction · 0.64
helloMethod · 0.64
WaitTillConnectedFunction · 0.64
TestMultipleRegisterFunction · 0.64
TestMultipleFunction · 0.64
TestGetKitesFunction · 0.64
TestKontrolFunction · 0.64
TestKontrolMultiKeyFunction · 0.64
TestRegisterToKontrolFunction · 0.64