config

package
Version: v0.0.0-...-9af805d Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2016 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppConfigContextVar = "app.config"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CfgLogLevel

type CfgLogLevel struct {
	logrus.Level
}

func (*CfgLogLevel) UnmarshalText

func (d *CfgLogLevel) UnmarshalText(data []byte) (err error)

type Config

type Config struct {
	Global  Global
	Logging Logging
	Topic   Topic
	Storage Storage
	Etcd    Etcd
}

func NewConfig

func NewConfig(filename string) (*Config, error)

func (*Config) LoadEnv

func (c *Config) LoadEnv() *Config

func (*Config) SetDefaults

func (c *Config) SetDefaults() *Config

SetDefaults applies default values to config structure.

type Etcd

type Etcd struct {
	// NoServer suppresses startup of etcd server
	NoServer bool `yaml:"no-server"`

	// StorageDir indicates where to save the etcd data
	StorageDir string `yaml:"storage-dir"`

	MinConnections int64
	MaxConnections int64

	Name                *string `yaml:"name"`
	InitialCluster      *string `yaml:"initial-cluster"`
	InitialClusterToken *string `yaml:"initial-cluster-token"`
	ClusterState        *string `yaml:"initial-cluster-state"`

	Client ServingInfo `yaml:"client"`
	Peer   ServingInfo `yaml:"peer"`

	AdvertiseClient EtcdURLs `yaml:"advertise-client"`
	AdvertisePeer   EtcdURLs `yaml:"advertise-peer"`

	Discovery EtcdDiscovery `yaml:",inline"`
}

type EtcdDiscovery

type EtcdDiscovery struct {
	DNSCluster *string `yaml:"discovery-srv"`
	Dproxy     *string `yaml:"discovery-proxy"`
	Durl       *string `yaml:"discovery"`
}

type EtcdURLs

type EtcdURLs struct {
	// URLs are the URLs for etcd
	URLs []string
}

type Global

type Global struct {
	// Address is the advertised host:port for client connections
	Address string
	// Logfile specifies logfile location
	Logfile string
	// Hostname specifies the node name
	Hostname string
	// Group specifies the name of the group
	Group string
	// FIXME
	Port int
}

type Logging

type Logging struct {
	Level            CfgLogLevel
	DisableColors    bool
	DisableTimestamp bool
	FullTimestamp    bool
	DisableSorting   bool
}

type SecurityConfig

type SecurityConfig struct {
	CertFile      string `yaml:"cert-file"`
	KeyFile       string `yaml:"key-file"`
	CertAuth      bool   `yaml:"client-cert-auth"`
	TrustedCAFile string `yaml:"trusted-ca-file"`
	AutoTLS       bool   `yaml:"auto-tls"`
}

type ServingInfo

type ServingInfo struct {
	EtcdURLs       `yaml:",inline"`
	SecurityConfig `yaml:",inline"`
}

type Storage

type Storage struct {
	// SyncPool specifies the number of concurrent processes synchronization chunks from other servers.
	SyncPool int
	// Driver
	Driver StorageDriver
	// CleanupPeriod sets time period between cleanup iterations.
	CleanupPeriod time.Duration `yaml:"cleanup-period"`
}

type StorageDriver

type StorageDriver map[string]storage.StorageDriverParameters

func (StorageDriver) Name

func (s StorageDriver) Name() string

func (StorageDriver) Parameters

type Topic

type Topic struct {
	// AllowTopicsCreation enables auto creation of topic on the server
	AllowTopicsCreation bool `yaml:"allow-topics-creation"`
	// WriteConcern describes the number of groups, which should confirm write of each block.
	// This value should not be more than the number of nodes in the cluster.
	WriteConcern int64 `yaml:"write-concern"`
	// MessageRetentionPeriod defines the maximum time we will retain a message.
	MessageRetentionPeriod time.Duration `yaml:"message-retention-period"`
	// PartitionSize defines maximum partition size.
	MaxPartitionSize int64 `yaml:"max-partition-size"`
	// MaxMessageSize defines maximum size of incoming message. Set 0 to disable.
	MaxMessageSize int64 `yaml:"max-message-size"`
	// ChunkSize defines maximum size of a block on which is divided the incoming message.
	MaxChunkSize int64 `yaml:"max-chunk-size"`
	// CleanupPeriod sets time period between cleanup iterations.
	CleanupPeriod time.Duration `yaml:"cleanup-period"`
}

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL