config

package
v2.2.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MaxNATSMsgSize = datasize.MB

MaxNATSMsgSize is the maximum size of message that NATS will accept.

Variables

Fs abstracts away filesystem access for the config package. It should only be modified by tests.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name                string            `toml:"name"`
	Mode                string            `toml:"mode"`
	NATSAddress         string            `toml:"nats_address"`
	NATSSubject         []string          `toml:"nats_subject"`
	NATSSubjectMonitor  string            `toml:"nats_subject_monitor"`
	NATSSubjectJunkyard string            `toml:"nats_subject_junkyard"`
	InfluxDBAddress     string            `toml:"influxdb_address"`
	InfluxDBPort        int               `toml:"influxdb_port"`
	InfluxDBUser        string            `toml:"-"`
	InfluxDBPass        string            `toml:"-"`
	DBName              string            `toml:"influxdb_dbname"`
	BatchMaxCount       int               `toml:"batch_max_count"`
	BatchMaxSize        datasize.ByteSize `toml:"batch_max_size"`
	BatchMaxAge         Duration          `toml:"batch_max_age"`
	Port                int               `toml:"port"`
	Workers             int               `toml:"workers"`
	WriteTimeout        Duration          `toml:"write_timeout"`
	WriterRetryBatches  int               `toml:"writer_retry_batches"`
	WriterRetryInterval Duration          `toml:"writer_retry_interval"`
	WriterRetryTimeout  Duration          `toml:"writer_retry_timeout"`
	ReadBufferSize      datasize.ByteSize `toml:"read_buffer_size"`
	NATSMaxPendingSize  datasize.ByteSize `toml:"nats_max_pending_size"`
	Rule                []Rule            `toml:"rule"`
	MaxTimeDelta        Duration          `toml:"max_time_delta"`
	StatsInterval       Duration          `toml:"stats_interval"`
	ProbePort           int               `toml:"probe_port"`
	PprofPort           int               `toml:"pprof_port"`
	Debug               bool              `toml:"debug"`
	DownsamplePeriod    Duration          `toml:"downsample_period"`
	DownsampleSuffix    string            `toml:"downsample_suffix"`
}

Config represents the configuration for a single influx-spout component.

func NewConfigFromFile

func NewConfigFromFile(fileName string) (*Config, error)

NewConfigFromFile parses the specified configuration file and returns a Config.

func (*Config) Validate

func (c *Config) Validate() error

Validate returns an error if a problem is detected with the configuration. It checks a variety of possible configuration errors but these aren't exhaustive.

type Duration

type Duration struct {
	time.Duration
}

Duration is used to support parsing of time durations directly into time.Duration instances. Use the embedded Duration field to access to the underlying time.Duration.

func NewDuration

func NewDuration(d time.Duration) Duration

NewDuration returns a new config.Duration which wraps a time.Duration.

func (*Duration) IsZero

func (d *Duration) IsZero() bool

IsZero returns true if the duration is 0.

func (*Duration) UnmarshalText

func (d *Duration) UnmarshalText(text []byte) error

UnmarshalText implements the TextUnmarshaler interface.

type Rule

type Rule struct {
	Rtype   string     `toml:"type"`
	Match   string     `toml:"match"`
	Tags    [][]string `toml:"tags"`
	Subject string     `toml:"subject"`
}

Rule contains the configuration for a single filter rule.

Jump to

Keyboard shortcuts

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