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

Struct Config

config/config.go:27–116  ·  view source on GitHub ↗

Options is passed to kite.New when creating new instance.

Source from the content-addressed store, hash-verified

25
26// Options is passed to kite.New when creating new instance.
27type Config struct {
28 // Options for Kite
29 Username string // Username to set when registering to Kontrol.
30 Environment string // Kite environment to set when registering to Kontrol.
31 Region string // Kite region to set when registering to Kontrol.
32 Id string // Kite ID to use when registering to Kontrol.
33 KiteKey string // The kite.key value to use for "kiteKey" authentication.
34 DisableAuthentication bool // Do not require authentication for requests.
35 DisableConcurrency bool // Do not process messages concurrently.
36 Transport Transport // SockJS transport to use.
37
38 IP string // IP of the kite server.
39 Port int // Port number of the kite server.
40
41 // VerifyFunc is used to verify the public key of the signed token.
42 //
43 // If the pub key is not to be trusted, the function must return
44 // kite.ErrKeyNotTrusted error.
45 //
46 // If nil, the default verify is used. By default the public key
47 // is verified by calling Kontrol and the result cached for
48 // VerifyTTL seconds if KontrolVerify is true. Otherwise
49 // only public keys that are the same as the KontrolKey one are
50 // accepted.
51 VerifyFunc func(pub string) error
52
53 // VerifyTTL is used to control time after result of a single
54 // VerifyFunc's call expires.
55 //
56 // When <0, the result is not cached.
57 //
58 // When 0, the default value of 300s is used.
59 VerifyTTL time.Duration
60
61 // VerifyAudienceFunc is used to verify the audience of JWT token.
62 //
63 // If nil, the default audience verify function is used which
64 // expects the aud to be a kite path that matches the username,
65 // environment and name of the client.
66 VerifyAudienceFunc func(client *protocol.Kite, aud string) error
67
68 // SockJS server / client connection configuration details.
69
70 // XHR is a HTTP client used for polling on responses for a XHR transport.
71 //
72 // Required.
73 XHR *http.Client
74
75 // Timeout specified max time waiting for the following operations to complete:
76 //
77 // - polling on an XHR connection
78 // - default timeout for certain kite requests (Kontrol API)
79 // - HTTP heartbeats and register method
80 //
81 // NOTE: Ensure the Timeout is higher than SockJS.HeartbeatDelay, otherwise
82 // XHR connections may get randomly closed.
83 //
84 // TODO(rjeczalik): Make kite heartbeats configurable as well.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected