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

Method NewClient

client.go:203–225  ·  view source on GitHub ↗

NewClient returns a pointer to a new Client. The returned instance is not connected. You have to call Dial() or DialForever() before calling Tell() and Go() methods.

(remoteURL string)

Source from the content-addressed store, hash-verified

201// is not connected. You have to call Dial() or DialForever() before calling
202// Tell() and Go() methods.
203func (k *Kite) NewClient(remoteURL string) *Client {
204 c := &Client{
205 LocalKite: k,
206 URL: remoteURL,
207 disconnect: make(chan struct{}),
208 closeChan: make(chan struct{}),
209 redialBackOff: forever,
210 scrubber: dnode.NewScrubber(),
211 testHookSetSession: nopSetSession,
212 Concurrent: true,
213 send: make(chan *message),
214 interrupt: make(chan error, 1),
215 ctx: context.Background(),
216 cancel: func() {},
217 }
218
219 c.OnConnect(c.setContext)
220 c.OnDisconnect(c.closeContext)
221
222 k.OnRegister(c.updateAuth)
223
224 return c
225}
226
227func (c *Client) SetUsername(username string) {
228 c.muProt.Lock()

Callers 15

SetupKontrolClientMethod · 0.95
getKitesMethod · 0.95
RegisterToProxyMethod · 0.95
sockjsHandlerMethod · 0.95
TestMethod_ThrottlingFunction · 0.80
TestMethod_LatestFunction · 0.80
TestMethod_FirstFunction · 0.80
TestMethod_ErrorFunction · 0.80
TestMethod_BaseFunction · 0.80
TestContextFunction · 0.80
TestMultipleFunction · 0.80
TestSendErrorFunction · 0.80

Calls 3

OnConnectMethod · 0.95
OnDisconnectMethod · 0.95
OnRegisterMethod · 0.95

Tested by 14

TestMethod_ThrottlingFunction · 0.64
TestMethod_LatestFunction · 0.64
TestMethod_FirstFunction · 0.64
TestMethod_ErrorFunction · 0.64
TestMethod_BaseFunction · 0.64
TestContextFunction · 0.64
TestMultipleFunction · 0.64
TestSendErrorFunction · 0.64
TestConcurrencyFunction · 0.64
TestKiteFunction · 0.64
TestKite_MultipleDialFunction · 0.64