configuration

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2014 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ONE_MEGABYTE = 1024 * 1024
	ONE_GIGABYTE = 1024 * ONE_MEGABYTE
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminConfig added in v0.4.0

type AdminConfig struct {
	Port   int
	Assets string
}

type ApiConfig added in v0.4.0

type ApiConfig struct {
	SslPort     int    `toml:"ssl-port"`
	SslCertPath string `toml:"ssl-cert"`
	Port        int
	ReadTimeout duration `toml:"read-timeout"`
}

type ClusterConfig added in v0.4.0

type ClusterConfig struct {
	SeedServers               []string `toml:"seed-servers"`
	ProtobufPort              int      `toml:"protobuf_port"`
	ProtobufTimeout           duration `toml:"protobuf_timeout"`
	ProtobufHeartbeatInterval duration `toml:"protobuf_heartbeat"`
	MinBackoff                duration `toml:"protobuf_min_backoff"`
	MaxBackoff                duration `toml:"protobuf_max_backoff"`
	WriteBufferSize           int      `toml:"write-buffer-size"`
	ConcurrentShardQueryLimit int      `toml:"concurrent-shard-query-limit"`
	MaxResponseBufferSize     int      `toml:"max-response-buffer-size"`
}

type Configuration

type Configuration struct {
	AdminHttpPort   int
	AdminAssetsDir  string
	ApiHttpSslPort  int
	ApiHttpCertPath string
	ApiHttpPort     int
	ApiReadTimeout  time.Duration

	GraphiteEnabled    bool
	GraphitePort       int
	GraphiteDatabase   string
	GraphiteUdpEnabled bool

	UdpInputEnabled  bool
	UdpInputPort     int
	UdpInputDatabase string

	RaftServerPort               int
	RaftTimeout                  duration
	SeedServers                  []string
	DataDir                      string
	RaftDir                      string
	ProtobufPort                 int
	ProtobufTimeout              duration
	ProtobufHeartbeatInterval    duration
	ProtobufMinBackoff           duration
	ProtobufMaxBackoff           duration
	Hostname                     string
	LogFile                      string
	LogLevel                     string
	BindAddress                  string
	LevelDbMaxOpenFiles          int
	LevelDbLruCacheSize          int
	LevelDbMaxOpenShards         int
	LevelDbPointBatchSize        int
	LevelDbWriteBatchSize        int
	ShortTermShard               *ShardConfiguration
	LongTermShard                *ShardConfiguration
	ReplicationFactor            int
	WalDir                       string
	WalFlushAfterRequests        int
	WalBookmarkAfterRequests     int
	WalIndexAfterRequests        int
	WalRequestsPerLogFile        int
	LocalStoreWriteBufferSize    int
	PerServerWriteBufferSize     int
	ClusterMaxResponseBufferSize int
	ConcurrentShardQueryLimit    int
	Version                      string
}

func LoadConfiguration

func LoadConfiguration(fileName string) *Configuration

func (*Configuration) AdminHttpPortString

func (self *Configuration) AdminHttpPortString() string

func (*Configuration) ApiHttpPortString

func (self *Configuration) ApiHttpPortString() string

func (*Configuration) ApiHttpSslPortString added in v0.4.1

func (self *Configuration) ApiHttpSslPortString() string

func (*Configuration) GraphitePortString added in v0.5.0

func (self *Configuration) GraphitePortString() string

func (*Configuration) HostnameOrDetect added in v0.4.0

func (self *Configuration) HostnameOrDetect() string

func (*Configuration) ProtobufConnectionString added in v0.4.0

func (self *Configuration) ProtobufConnectionString() string

func (*Configuration) ProtobufListenString added in v0.5.12

func (self *Configuration) ProtobufListenString() string

func (*Configuration) RaftConnectionString added in v0.5.12

func (self *Configuration) RaftConnectionString() string

func (*Configuration) RaftListenString added in v0.5.12

func (self *Configuration) RaftListenString() string

func (*Configuration) UdpInputPortString added in v0.6.0

func (self *Configuration) UdpInputPortString() string

type GraphiteConfig added in v0.5.0

type GraphiteConfig struct {
	Enabled    bool
	Port       int
	Database   string
	UdpEnabled bool `toml:"udp_enabled"`
}

type InputPlugins added in v0.5.0

type InputPlugins struct {
	Graphite GraphiteConfig `toml:"graphite"`
	UdpInput UdpInputConfig `toml:"udp"`
}

type LevelDbConfiguration added in v0.4.4

type LevelDbConfiguration struct {
	MaxOpenFiles   int  `toml:"max-open-files"`
	LruCacheSize   size `toml:"lru-cache-size"`
	MaxOpenShards  int  `toml:"max-open-shards"`
	PointBatchSize int  `toml:"point-batch-size"`
	WriteBatchSize int  `toml:"write-batch-size"`
}

type LoggingConfig added in v0.4.0

type LoggingConfig struct {
	File  string
	Level string
}

type RaftConfig added in v0.4.0

type RaftConfig struct {
	Port    int
	Dir     string
	Timeout duration `toml:"election-timeout"`
}

type ShardConfiguration added in v0.5.0

type ShardConfiguration struct {
	Duration string

	Split       int
	SplitRandom string `toml:"split-random"`
	// contains filtered or unexported fields
}

func (*ShardConfiguration) HasRandomSplit added in v0.5.0

func (self *ShardConfiguration) HasRandomSplit() bool

func (*ShardConfiguration) ParseAndValidate added in v0.5.0

func (self *ShardConfiguration) ParseAndValidate(defaultShardDuration time.Duration) error

func (*ShardConfiguration) ParsedDuration added in v0.5.0

func (self *ShardConfiguration) ParsedDuration() *time.Duration

func (*ShardConfiguration) SplitRegex added in v0.5.0

func (self *ShardConfiguration) SplitRegex() *regexp.Regexp

type ShardingDefinition added in v0.5.0

type ShardingDefinition struct {
	ReplicationFactor int                `toml:"replication-factor"`
	ShortTerm         ShardConfiguration `toml:"short-term"`
	LongTerm          ShardConfiguration `toml:"long-term"`
}

type StorageConfig added in v0.4.0

type StorageConfig struct {
	Dir             string
	WriteBufferSize int `toml:"write-buffer-size"`
}

type TomlConfiguration added in v0.4.0

type TomlConfiguration struct {
	Admin        AdminConfig
	HttpApi      ApiConfig    `toml:"api"`
	InputPlugins InputPlugins `toml:"input_plugins"`
	Raft         RaftConfig
	Storage      StorageConfig
	Cluster      ClusterConfig
	Logging      LoggingConfig
	LevelDb      LevelDbConfiguration
	Hostname     string
	BindAddress  string             `toml:"bind-address"`
	Sharding     ShardingDefinition `toml:"sharding"`
	WalConfig    WalConfig          `toml:"wal"`
}

type UdpInputConfig added in v0.6.0

type UdpInputConfig struct {
	Enabled  bool
	Port     int
	Database string
}

type WalConfig added in v0.5.0

type WalConfig struct {
	Dir                   string `toml:"dir"`
	FlushAfterRequests    int    `toml:"flush-after"`
	BookmarkAfterRequests int    `toml:"bookmark-after"`
	IndexAfterRequests    int    `toml:"index-after"`
	RequestsPerLogFile    int    `toml:"requests-per-log-file"`
}

Jump to

Keyboard shortcuts

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