config

package
v0.0.0-...-6496225 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCurrentConfig

func GetCurrentConfig() string

func ParamAsBool

func ParamAsBool(params map[string]interface{}, param string) (result bool, ok bool)

func ParamAsDuration

func ParamAsDuration(params map[string]interface{}, param string) (result time.Duration, ok bool)

func ParamAsDurationWithLimit

func ParamAsDurationWithLimit(params map[string]interface{}, param string, min time.Duration, max time.Duration) (result time.Duration, ok bool)

func ParamAsFloat

func ParamAsFloat(params map[string]interface{}, param string) (result float64, ok bool)

func ParamAsFloatWithLimit

func ParamAsFloatWithLimit(params map[string]interface{}, param string, min float64, max float64) (result float64, ok bool)

func ParamAsInt

func ParamAsInt(params map[string]interface{}, param string) (result int, ok bool)

func ParamAsInt32

func ParamAsInt32(params map[string]interface{}, param string) (result int32, ok bool)

func ParamAsInt32WithLimit

func ParamAsInt32WithLimit(params map[string]interface{}, param string, min int32, max int32) (result int32, ok bool)

func ParamAsInt64

func ParamAsInt64(params map[string]interface{}, param string) (result int64, ok bool)

func ParamAsInt64WithLimit

func ParamAsInt64WithLimit(params map[string]interface{}, param string, min int64, max int64) (result int64, ok bool)

func ParamAsIntWithLimit

func ParamAsIntWithLimit(params map[string]interface{}, param string, min int, max int) (result int, ok bool)

func ParamAsString

func ParamAsString(params map[string]interface{}, param string) (result string, ok bool)

func ParamAsUint

func ParamAsUint(params map[string]interface{}, param string) (result uint, ok bool)

func ParamAsUint32

func ParamAsUint32(params map[string]interface{}, param string) (result uint32, ok bool)

func ParamAsUint32WithLimit

func ParamAsUint32WithLimit(params map[string]interface{}, param string, min uint32, max uint32) (result uint32, ok bool)

func ParamAsUint64

func ParamAsUint64(params map[string]interface{}, param string) (result uint64, ok bool)

func ParamAsUint64WithLimit

func ParamAsUint64WithLimit(params map[string]interface{}, param string, min uint64, max uint64) (result uint64, ok bool)

func ParamAsUintWithLimit

func ParamAsUintWithLimit(params map[string]interface{}, param string, min uint, max uint) (result uint, ok bool)

func SetCurrentConfig

func SetCurrentConfig(configFile string)

Types

type AdminConfig

type AdminConfig struct {
	Enabled     bool      `json:"enabled"`
	HTTPAddress string    `json:"httpAddress,omitempty"`
	TLS         TLSConfig `json:"tls,omitempty"`
}

type BufferConfig

type BufferConfig struct {
	Path            string             `json:"path,omitempty"`
	Prefix          string             `json:"prefix,omitempty"`
	Extension       string             `json:"extension,omitempty"`
	MaxMessageSize  int                `json:"maxMessageSize"`
	TimestampKey    string             `json:"timestampKey,omitempty"`
	TimestampFormat string             `json:"timestampFormat,omitempty"`
	Flush           FlushConfig        `json:"flush,omitempty"`
	DiskWatchDog    DiskWatchDogConfig `json:"diskWatchDog,omitempty"`
}

func (*BufferConfig) GetExtension

func (cfg *BufferConfig) GetExtension() string

func (*BufferConfig) GetFlushCount

func (cfg *BufferConfig) GetFlushCount() int

func (*BufferConfig) GetFlushOnEverySec

func (cfg *BufferConfig) GetFlushOnEverySec() time.Duration

func (*BufferConfig) GetFlushSize

func (cfg *BufferConfig) GetFlushSize() int

func (*BufferConfig) GetMaxMessageSize

func (cfg *BufferConfig) GetMaxMessageSize() int

func (*BufferConfig) GetPath

func (cfg *BufferConfig) GetPath() string

func (*BufferConfig) GetPrefix

func (cfg *BufferConfig) GetPrefix() string

func (*BufferConfig) GetTimestampFormat

func (cfg *BufferConfig) GetTimestampFormat() string

type DiskWatchDogConfig

type DiskWatchDogConfig struct {
	Enabled             bool          `json:"enabled"`
	Immediate           bool          `json:"immediate"`
	MinSizeInMB         int           `json:"minSizeInMB"`
	MinSizeInPercentage float64       `json:"minSizeInPercentage"`
	KeepLastXHours      int           `json:"keepLastXHours"`
	OnEverySec          time.Duration `json:"onEverySec"`
}

func (*DiskWatchDogConfig) GetKeepLastXHours

func (cfg *DiskWatchDogConfig) GetKeepLastXHours() int

func (*DiskWatchDogConfig) GetMinSizeInMB

func (cfg *DiskWatchDogConfig) GetMinSizeInMB() int

func (*DiskWatchDogConfig) GetMinSizeInPercentage

func (cfg *DiskWatchDogConfig) GetMinSizeInPercentage() float64

func (*DiskWatchDogConfig) GetOnEverySec

func (cfg *DiskWatchDogConfig) GetOnEverySec() time.Duration

type FluentConfig

type FluentConfig struct {
	MemProfile  string        `json:"memprofile,omitempty"`
	CPUProfile  string        `json:"cpuprofile,omitempty"`
	ProfileURL  string        `json:"profileURL,omitempty"`
	ServiceMode string        `json:"serviceMode,omitempty"`
	Log         LogConfig     `json:"log,omitempty"`
	Inputs      InputsConfig  `json:"inputs,omitempty"`
	Outputs     OutputsConfig `json:"outputs,omitempty"`
	Admin       AdminConfig   `json:"admin,omitempty"`
}

func LoadConfig

func LoadConfig(configFile string) *FluentConfig

type FlushConfig

type FlushConfig struct {
	Count      int           `json:"count"`
	Size       int           `json:"size"`
	OnEverySec time.Duration `json:"onEverySec"`
}

type InOutConfig

type InOutConfig struct {
	Type        string             `json:"type,omitempty"`
	Name        string             `json:"name,omitempty"`
	Description string             `json:"description,omitempty"`
	Filter      string             `json:"filter,omitempty"`
	Params      []inOutParamConfig `json:"params,omitempty"`
}

func (*InOutConfig) GetParamsMap

func (cfg *InOutConfig) GetParamsMap() map[string]interface{}

type InQConfig

type InQConfig struct {
	MaxCount int    `json:"maxCount"`
	MaxSize  uint64 `json:"maxSize"`
}

func (*InQConfig) GetMaxParams

func (cfg *InQConfig) GetMaxParams() (maxCount int, maxSize uint64)

type InputsConfig

type InputsConfig struct {
	Filter      string        `json:"filter,omitempty"`
	Queue       InQConfig     `json:"queue,omitempty"`
	Buffer      BufferConfig  `json:"buffer,omitempty"`
	OrphanFiles OrphanConfig  `json:"orphanFiles,omitempty"`
	Producers   []InOutConfig `json:"producers,omitempty"`
}

type LogConfig

type LogConfig struct {
	Enabled     bool   `json:"enabled"`
	Console     bool   `json:"console"`
	Path        string `json:"path,omitempty"`
	Type        string `json:"type,omitempty"`
	RollingSize int    `json:"rollingSize"`
}

func (*LogConfig) GetPath

func (cfg *LogConfig) GetPath() string

type OrphanConfig

type OrphanConfig struct {
	DeleteAll       bool `json:"deleteAll"`
	ReplayLastXDays int  `json:"replayLastXDays"`
}

func (*OrphanConfig) GetDeleteAll

func (cfg *OrphanConfig) GetDeleteAll() bool

func (*OrphanConfig) GetReplayLastXDays

func (cfg *OrphanConfig) GetReplayLastXDays() int

type OutQConfig

type OutQConfig struct {
	ChunkSize          int           `json:"chunkSize"`
	MaxCount           int           `json:"maxCount"`
	WaitPopForMillisec time.Duration `json:"waitPopForMillisec"`
}

func (*OutQConfig) GetParams

func (cfg *OutQConfig) GetParams() (chunkSize, maxCount int, waitPopForMillisec time.Duration)

type OutputsConfig

type OutputsConfig struct {
	Debug            bool          `json:"debug,omitempty"`
	BulkCount        int           `json:"bulkCount"`
	MaxMessageSize   int           `json:"maxMessageSize"`
	TimestampKey     string        `json:"timestampKey,omitempty"`
	TimestampFormat  string        `json:"timestampFormat,omitempty"`
	Path             string        `json:"dir,omitempty"`
	Pattern          string        `json:"dataPattern,omitempty"`
	Filter           string        `json:"filter,omitempty"`
	FlushOnEverySec  time.Duration `json:"flushOnEverySec"`
	SleepOnEverySec  time.Duration `json:"sleepOnEverySec"`
	SleepForMillisec time.Duration `json:"sleepForMillisec"`
	Queue            OutQConfig    `json:"queue,omitempty"`
	Consumers        []InOutConfig `json:"consumers,omitempty"`
	OrphanFiles      OrphanConfig  `json:"orphanFiles,omitempty"`
}

func (*OutputsConfig) GetBulkCount

func (cfg *OutputsConfig) GetBulkCount() int

func (*OutputsConfig) GetDataPath

func (cfg *OutputsConfig) GetDataPath(inCfg *InputsConfig) string

func (*OutputsConfig) GetDataPattern

func (cfg *OutputsConfig) GetDataPattern(inCfg *InputsConfig) string

func (*OutputsConfig) GetDebugIsOn

func (cfg *OutputsConfig) GetDebugIsOn() bool

func (*OutputsConfig) GetMaxMessageSize

func (cfg *OutputsConfig) GetMaxMessageSize() int

func (*OutputsConfig) GetSleepForMillisec

func (cfg *OutputsConfig) GetSleepForMillisec() time.Duration

func (*OutputsConfig) GetSleepOnEverySec

func (cfg *OutputsConfig) GetSleepOnEverySec() time.Duration

func (*OutputsConfig) GetTimestampFormat

func (cfg *OutputsConfig) GetTimestampFormat() string

type TLSConfig

type TLSConfig struct {
	CertFile  string `json:"certFile,omitempty"`
	KeyFile   string `json:"keyFile,omitempty"`
	CAFile    string `json:"caFile,omitempty"`
	VerifySsl bool   `json:"verifySsl,omitempty"`
}

Jump to

Keyboard shortcuts

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