Documentation ¶
Index ¶
- func GetLocalHost() string
- func MockBatchPoints() client.BatchPoints
- func TestPoint(value interface{}, name ...string) *client.Point
- type Accumulator
- func (a *Accumulator) Add(measurement string, value interface{}, tags map[string]string, t ...time.Time)
- func (a *Accumulator) AddDefaultTag(key, value string)
- func (a *Accumulator) AddFields(measurement string, fields map[string]interface{}, tags map[string]string, ...)
- func (a *Accumulator) CheckFieldsValue(measurement string, fields map[string]interface{}) bool
- func (a *Accumulator) CheckTaggedFieldsValue(measurement string, fields map[string]interface{}, tags map[string]string) bool
- func (a *Accumulator) CheckTaggedValue(measurement string, val interface{}, tags map[string]string) bool
- func (a *Accumulator) CheckValue(measurement string, val interface{}) bool
- func (a *Accumulator) Debug() bool
- func (a *Accumulator) Get(measurement string) (*Point, bool)
- func (a *Accumulator) HasFloatValue(measurement string) bool
- func (a *Accumulator) HasIntValue(measurement string) bool
- func (a *Accumulator) HasMeasurement(measurement string) bool
- func (a *Accumulator) HasUIntValue(measurement string) bool
- func (a *Accumulator) Prefix() string
- func (a *Accumulator) SetDebug(debug bool)
- func (a *Accumulator) SetDefaultTags(tags map[string]string)
- func (a *Accumulator) SetPrefix(prefix string)
- func (a *Accumulator) ValidateFieldsValue(measurement string, fields map[string]interface{}) error
- func (a *Accumulator) ValidateTaggedFields(measurement string, fields map[string]interface{}, tags map[string]string) error
- func (a *Accumulator) ValidateTaggedFieldsValue(measurement string, fields map[string]interface{}, tags map[string]string) error
- func (a *Accumulator) ValidateTaggedValue(measurement string, val interface{}, tags map[string]string) error
- func (a *Accumulator) ValidateValue(measurement string, val interface{}) error
- type Point
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLocalHost ¶ added in v0.1.4
func GetLocalHost() string
GetLocalHost returns the DOCKER_HOST environment variable, parsing out any scheme or ports so that only the IP address is returned.
func MockBatchPoints ¶ added in v0.1.7
func MockBatchPoints() client.BatchPoints
MockBatchPoints returns a mock BatchPoints object for using in unit tests of telegraf output sinks.
Types ¶
type Accumulator ¶
Accumulator defines a mocked out accumulator
func (*Accumulator) Add ¶
func (a *Accumulator) Add( measurement string, value interface{}, tags map[string]string, t ...time.Time, )
Add adds a measurement point to the accumulator
func (*Accumulator) AddDefaultTag ¶ added in v0.2.0
func (a *Accumulator) AddDefaultTag(key, value string)
func (*Accumulator) AddFields ¶ added in v0.2.0
func (a *Accumulator) AddFields( measurement string, fields map[string]interface{}, tags map[string]string, timestamp ...time.Time, )
AddFields adds a measurement point with a specified timestamp.
func (*Accumulator) CheckFieldsValue ¶ added in v0.2.1
func (a *Accumulator) CheckFieldsValue(measurement string, fields map[string]interface{}) bool
CheckValue checks that the accumulators point for the given measurement is the same as the given value.
func (*Accumulator) CheckTaggedFieldsValue ¶ added in v0.2.1
func (a *Accumulator) CheckTaggedFieldsValue( measurement string, fields map[string]interface{}, tags map[string]string, ) bool
CheckTaggedFieldsValue calls ValidateTaggedFieldsValue
func (*Accumulator) CheckTaggedValue ¶
func (a *Accumulator) CheckTaggedValue( measurement string, val interface{}, tags map[string]string, ) bool
CheckTaggedValue calls ValidateTaggedValue
func (*Accumulator) CheckValue ¶
func (a *Accumulator) CheckValue(measurement string, val interface{}) bool
CheckValue calls CheckFieldsValue passing a single-value map as fields
func (*Accumulator) Debug ¶ added in v0.2.0
func (a *Accumulator) Debug() bool
func (*Accumulator) Get ¶
func (a *Accumulator) Get(measurement string) (*Point, bool)
Get gets the specified measurement point from the accumulator
func (*Accumulator) HasFloatValue ¶
func (a *Accumulator) HasFloatValue(measurement string) bool
HasFloatValue returns true if the given measurement has a float value
func (*Accumulator) HasIntValue ¶
func (a *Accumulator) HasIntValue(measurement string) bool
HasIntValue returns true if the measurement has an Int value
func (*Accumulator) HasMeasurement ¶ added in v0.1.8
func (a *Accumulator) HasMeasurement(measurement string) bool
HasMeasurement returns true if the accumulator has a measurement with the given name
func (*Accumulator) HasUIntValue ¶ added in v0.1.4
func (a *Accumulator) HasUIntValue(measurement string) bool
HasUIntValue returns true if the measurement has a UInt value
func (*Accumulator) Prefix ¶ added in v0.2.0
func (a *Accumulator) Prefix() string
func (*Accumulator) SetDebug ¶ added in v0.2.0
func (a *Accumulator) SetDebug(debug bool)
func (*Accumulator) SetDefaultTags ¶ added in v0.2.0
func (a *Accumulator) SetDefaultTags(tags map[string]string)
func (*Accumulator) SetPrefix ¶ added in v0.2.0
func (a *Accumulator) SetPrefix(prefix string)
func (*Accumulator) ValidateFieldsValue ¶ added in v0.2.1
func (a *Accumulator) ValidateFieldsValue( measurement string, fields map[string]interface{}, ) error
ValidateFieldsValue calls ValidateTaggedFieldsValue
func (*Accumulator) ValidateTaggedFields ¶ added in v0.2.1
func (*Accumulator) ValidateTaggedFieldsValue ¶ added in v0.2.1
func (a *Accumulator) ValidateTaggedFieldsValue( measurement string, fields map[string]interface{}, tags map[string]string, ) error
ValidateTaggedValue validates that the given measurement and value exist in the accumulator and with the given tags.
func (*Accumulator) ValidateTaggedValue ¶
func (a *Accumulator) ValidateTaggedValue( measurement string, val interface{}, tags map[string]string, ) error
ValidateTaggedValue calls ValidateTaggedFieldsValue passing a single-value map as fields
func (*Accumulator) ValidateValue ¶
func (a *Accumulator) ValidateValue(measurement string, val interface{}) error
ValidateValue calls ValidateTaggedValue