configs

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2016 License: MIT Imports: 9 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfigs = `` /* 1232-byte string literal not displayed */

Functions

func InitializeConfig

func InitializeConfig(f string, p map[string]string) error

func SetConfig

func SetConfig(cfg *Conf)

func Update

func Update(settings map[string]interface{}) error

Types

type AESConf

type AESConf struct {
	KEY string `json:"key" assign:"key;;-"`
	IV  string `json:"iv" assign:"iv;;-"`
}

type Conf

type Conf struct {
	Service     *ServiceConf     `json:"service" assign:"service;;-"`
	Security    *SecurityConf    `json:"security" assign:"security;;"`
	Connections *ConnectionsConf `json:"connections" assign:"connections;;"`
	Indices     *IndexConf       `json:"indices" assign:"indices;;"`
	Database    *DbConf          `json:"database" assign:"database;;-"`
	Logging     *LogsConf        `json:"logging" assign:"logging;;-"`
}

func Config

func Config() *Conf

func ReadConfig

func ReadConfig(buf io.Reader) (*Conf, error)

func (*Conf) DeepCopy

func (cfg *Conf) DeepCopy() (*Conf, error)

type ConnectionsConf

type ConnectionsConf struct {
	Registry      string              `json:"registry" assign:"registry;;-"`
	NShards       int                 `json:"nshards" assign:"nshards;;-"`
	InitShardSize int                 `json:"init_shard_size" assign:"init_shard_size;;-"`
	Http          *HttpConnectionConf `json:"http" assign:"http;;"`
	Websocket     *WsConnectionConf   `json:"websocket" assign:"websocket;;"`
}

type DashboardSecurityConf

type DashboardSecurityConf struct {
	Username    string        `json:"username" assign:"username;;"`
	Password    string        `json:"-" assign:"password;;"`
	TokenExpiry *JSONDuration `json:"token_expiry" assign:"token_expiry;jsonduration;"`
	AES         *AESConf      `json:"-" assign:"aes;;-"`
}

type DbConf

type DbConf struct {
	DbType string `json:"db_type" assign:"db_type;;-"`
	DbFile string `json:"db_file" assign:"db_file;;-"`
}

type HttpConnectionConf

type HttpConnectionConf struct {
	Timeouts *HttpConnectionTimeoutConf `json:"timeouts" assign:"timeouts;;"`
}

type HttpConnectionTimeoutConf

type HttpConnectionTimeoutConf struct {
	LongPolling *JSONDuration `json:"long_polling" assign:"long_polling;jsonduration;"`
}

type IndexConf

type IndexConf struct {
	Disable          bool          `json:"disable" assign:"disable;;"`
	Host             string        `json:"host" assign:"host;;-"`
	Port             int           `json:"port" assign:"port;;-"`
	NumberOfShards   int           `json:"number_of_shards" assign:"number_of_shards;;-"`
	NumberOfReplicas int           `json:"number_of_replicas" assign:"number_of_replicas;;-"`
	TTLEnabled       bool          `json:"ttl_enabled" assign:"ttl_enabled;;-"`
	TTL              *JSONDuration `json:"ttl" assign:"ttl;jsonduration;-"`
}

type LogConf

type LogConf struct {
	Filename   string `json:"filename" assign:"filename;;-"`
	MaxSize    int    `json:"maxsize" assign:"maxsize;;-"`
	MaxAge     int    `json:"maxage" assign:"maxage;;-"`
	MaxBackups int    `json:"maxbackups" assign:"maxbackups;;-"`
	Level      string `json:"level" assign:"level;;-"`
	BufferSize int    `json:"buffer_size" assign:"buffer_size;;-"`
}

type LogsConf

type LogsConf struct {
	Eywa     *LogConf `json:"eywa" assign:"eywa;;-"`
	Indices  *LogConf `json:"indices" assign:"indices;;-"`
	Database *LogConf `json:"database" assign:"database;;-"`
}

type SSLConf

type SSLConf struct {
	CertFile string `json:"cert_file" assign:"cert_file;;-"`
	KeyFile  string `json:"key_file" assign:"key_file;;-"`
}

type SecurityConf

type SecurityConf struct {
	Dashboard *DashboardSecurityConf `json:"dashboard" assign:"dashboard;;"`
	SSL       *SSLConf               `json:"-" assign:"ssl;;-"`
	ApiKey    string                 `json:"-" assign:"api_key;;"`
}

type ServiceConf

type ServiceConf struct {
	Host       string `json:"host" assign:"host;;-"`
	ApiPort    int    `json:"api_port" assign:"api_port;;-"`
	DevicePort int    `json:"device_port" assign:"device_port;;-"`
	PidFile    string `json:"-" assign:"pid_file;;-"`
	Assets     string `json:"-" assign:"assets;;-"`
}

type WsConnectionBufferSizeConf

type WsConnectionBufferSizeConf struct {
	Write int `json:"write" assign:"write;;"`
	Read  int `json:"read" assign:"read;;"`
}

type WsConnectionConf

type WsConnectionConf struct {
	RequestQueueSize int                         `json:"request_queue_size" assign:"request_queue_size;;"`
	Timeouts         *WsConnectionTimeoutConf    `json:"timeouts" assign:"timeouts;;"`
	BufferSizes      *WsConnectionBufferSizeConf `json:"buffer_sizes" assign:"buffer_sizes;;"`
}

type WsConnectionTimeoutConf

type WsConnectionTimeoutConf struct {
	Write    *JSONDuration `json:"write" assign:"write;jsonduration;"`
	Read     *JSONDuration `json:"read" assign:"read;jsonduration;"`
	Request  *JSONDuration `json:"request" assign:"request;jsonduration;"`
	Response *JSONDuration `json:"response" assign:"response;jsonduration;"`
}

Jump to

Keyboard shortcuts

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