Documentation
¶
Index ¶
- type Encoder
- func (a *Encoder) Encode(prefix string, val interface{}, tags map[string]string, opts ...Option) error
- func (a *Encoder) EncodeMap(prefix string, val map[string]interface{}, tags map[string]string, ...) error
- func (a *Encoder) EncodeWithoutTypes(prefix string, val interface{}, tags map[string]string, opts ...Option) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
Encoder represents a component that encapsulates a target environment for measurement submissions, as given by hostname and receiving writer.
func NewEncoder ¶
NewEncoder creates a new encoder that writes to the given io.Writer.
func NewEncoderWithHostname ¶
NewEncoderWithHostname creates a new encoder that writes to the given io.Writer with an overridden hostname
func (*Encoder) Encode ¶
func (a *Encoder) Encode(prefix string, val interface{}, tags map[string]string, opts ...Option) error
Encode writes the line protocol representation for a given measurement name, data struct and tag map to the io.Writer specified on encoder creation.
func (*Encoder) EncodeMap ¶
func (a *Encoder) EncodeMap(prefix string, val map[string]interface{}, tags map[string]string, opts ...Option) error
EncodeMap writes the line protocol representation for a given measurement name, field value map and tag map to the io.Writer specified on encoder creation.
func (*Encoder) EncodeWithoutTypes ¶
func (a *Encoder) EncodeWithoutTypes(prefix string, val interface{}, tags map[string]string, opts ...Option) error
EncodeWithoutTypes writes the line protocol representation for a given measurement name, data struct and tag map to the io.Writer specified on encoder creation. In contrast to Encode(), this method never appends type suffixes to values.