Documentation ¶
Overview ¶
Package config contains a Config struct for kites.
Index ¶
Constants ¶
View Source
const ( WebSocket = iota XHRPolling )
Variables ¶
View Source
var DefaultConfig = &Config{ Username: "unknown", Environment: "unknown", Region: "unknown", IP: "0.0.0.0", Port: 0, Transport: WebSocket, }
DefaultConfig contains the default settings.
View Source
var Transports = map[string]Transport{ "WebSocket": WebSocket, "XHRPolling": XHRPolling, }
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Options for Kite Username string Environment string Region string Id string KiteKey string DisableAuthentication bool DisableConcurrency bool Transport Transport // Options for Server IP string Port int // VerifyFunc is used to verify the public key of the signed token. // // If the pub key is not to be trusted, the function must return // kite.ErrKeyNotTrusted error. // // If nil, the default verify is used. By default the public key // is verified by calling Kontrol and the result cached for // VerifyTTL seconds if KontrolVerify is true. Otherwise // only public keys that are the same as the KontrolKey one are // accepted. VerifyFunc func(pub string) error // VerifyTTL is used to control time after result of a single // VerifyFunc's call expires. // // When <0, the result is not cached. // // When 0, the default value of 300s is used. VerifyTTL time.Duration // VerifyAudienceFunc is used to verify the audience of JWT token. // // If nil, the default audience verify function is used which // expects the aud to be a kite path that matches the username, // environment and name of the client. VerifyAudienceFunc func(client *protocol.Kite, aud string) error KontrolURL string KontrolKey string KontrolUser string }
Options is passed to kite.New when creating new instance.
func NewFromKiteKey ¶
NewFromKiteKey parses the given kite key file and gives a new Config value.
func (*Config) ReadEnvironmentVariables ¶
func (*Config) ReadKiteKey ¶
ReadKiteKey parsed the user's kite key and returns a new Config.
Click to show internal directories.
Click to hide internal directories.