config

package
v0.0.0-...-8ac874d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2016 License: MIT Imports: 4 Imported by: 0

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

	KontrolURL  string
	KontrolKey  string
	KontrolUser string
}

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

func Get

func Get() (*Config, error)

func MustGet

func MustGet() *Config

func New

func New() *Config

New returns a new Config initialized with defaults.

func (*Config) Copy

func (c *Config) Copy() *Config

Copy returns a new copy of the config object.

func (*Config) ReadEnvironmentVariables

func (c *Config) ReadEnvironmentVariables() error

func (*Config) ReadKiteKey

func (c *Config) ReadKiteKey() error

ReadKiteKey parsed the user's kite key and returns a new Config.

type Transport

type Transport int

Transport defines the underlying transport to be used

func (Transport) String

func (t Transport) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL