Documentation ¶
Index ¶
- Constants
- func ParseValue(t FieldType, value string) interface{}
- type ComposedFilter
- type ComposedInput
- type ComposedOutput
- type Decoder
- type DecoderAdapter
- type DecoderToWriter
- type EncodeToWriter
- type Encoder
- type EncoderAdapter
- type Feedback
- type Field
- type FieldType
- type Filter
- func NewByPassFilter() (Filter, error)
- func NewComposedFilter(flts ...Filter) (Filter, error)
- func NewFieldInjectorFilter(fields ...Field) (Filter, error)
- func NewFilter(adapter FilterAdapter, finalizer FinalizeAdapter) (Filter, error)
- func NewLogFilter(label string) (Filter, error)
- func NewMeasureCountFilter() (Filter, error)
- func NewNameInjectorFilter(name string) (Filter, error)
- func NewNameSanityFilter() (Filter, error)
- func NewTagInjectorFilter(tags ...Tag) (Filter, error)
- func NewTimeInjectorFilter(time int64) (Filter, error)
- type FilterAdapter
- type FilteredInput
- type FilteredOutput
- type FinalizeAdapter
- type Helpers
- type IOPipeline
- type Input
- type Measure
- func (m *Measure) Field(name string) (Field, error)
- func (m *Measure) FieldValue(name string) (interface{}, error)
- func (m *Measure) InsertOrUpdateTag(name string, data string)
- func (m *Measure) MD5() []byte
- func (m *Measure) SHA1() []byte
- func (m *Measure) Tag(name string) (Tag, error)
- func (m *Measure) TagValue(name string) (string, error)
- type MeasureReader
- type MeasureWriter
- type MergedInput
- type MergedOutput
- type Output
- type PushSinker
- type Runnable
- type Sinker
- func NewBasicHTTPSinker(url, user, pwd string) (Sinker, error)
- func NewPushSinker(push PushSinker) (Sinker, error)
- func NewSinker(adapter SinkerAdapter) (Sinker, error)
- func NewStdoutSinker() (Sinker, error)
- func NewTCPSinker(addr string) (Sinker, error)
- func NewWriteCloserSinker(out io.WriteCloser) (Sinker, error)
- func NewWriterSinker(out io.Writer) (Sinker, error)
- type SinkerAdapter
- type Source
- type SourceAdapter
- type SourceGetter
- type Tag
Constants ¶
const ( //TBool is a boolean TBool = 'b' //TInt is an integer TInt = 'i' //TUint is an unsigned integer TUint = 'u' //TFloat is a float TFloat = 'f' //TString is a string TString = 's' //TNil is a nil value TNil = 'n' )
Variables ¶
This section is empty.
Functions ¶
func ParseValue ¶
ParseValue parse a value from a FieldType
Types ¶
type ComposedFilter ¶
ComposedFilter composes a set of filters in a chain
type ComposedInput ¶
ComposedInput composes a Source and Encoder and returns an Input function
type ComposedOutput ¶
ComposedOutput composes a Source and Encoder and returns an Input function
type Decoder ¶
type Decoder func(Feedback, MeasureReader) (io.ReadCloser, error)
Decoder takes a Feedback function and a Measure Reader and returns a generic reader and an error if any Decoder should read measures from the receiver Measure Read, transform it and write the results down to the returned stream Initialization errors should be returned using the error object Runtime errors should be send to the Feedback function.
func NewGenericDecoder ¶
func NewGenericDecoder(decw DecoderToWriter) (Decoder, error)
NewGenericDecoder is
type DecoderAdapter ¶
type DecoderAdapter func(Feedback, MeasureReader, io.Writer)
DecoderAdapter takes
type Encoder ¶
type Encoder func(Feedback, io.ReadCloser) (MeasureReader, error)
Encoder takes a Feedback function and a stream reader and returns a measure Reader and an error if any Encoder should read from the received stream and write encoded metrics into a Writer function. The data will be available to other systems through the returned Reader Initialization errors should be returned using the error object Runtime errors should be send to the Feedback function.
func NewEncoder ¶
func NewEncoder(adapter EncoderAdapter) (Encoder, error)
NewEncoder builds an encoder function
func NewFromJSONEncoder ¶
func NewFromJSONEncoder(data interface{}, encode EncodeToWriter) (Encoder, error)
NewFromJSONEncoder is
type EncoderAdapter ¶
type EncoderAdapter func(Feedback, io.Reader, MeasureWriter)
EncoderAdapter takes
type Feedback ¶
type Feedback func(format string, a ...interface{})
Feedback takes a format string and a list of interfaces to assemble a string. It was create to receive feedbacks (info, error messages) from other components in a centralized way
type Field ¶
type Field struct { Name string `json:"name,omitempty"` Type FieldType `json:"type,omitempty"` Data interface{} `json:"data,omitempty"` }
Field is the non-indexed portion of a measure where one can input metrics
func ParseField ¶
ParseField parse a field from string
type FieldType ¶
type FieldType byte
FieldType represents the type of a field data
func FieldValueType ¶
func FieldValueType(value interface{}) FieldType
FieldValueType returns the type of a field
type Filter ¶
type Filter func(Feedback, MeasureReader) (MeasureReader, error)
Filter takes a Feedback funtion and a Measure Reader function and returns anoter Measure Reader funtion Filter should read measures from the received Measure Read, apply some kind of filter logic and write the results down to the output Reader Initialization errors should be returned using the error object Runtime errors should be send to the Feedback function.
func NewByPassFilter ¶
NewByPassFilter takes a name and returns a Filter that inject that name on every measure received
func NewComposedFilter ¶
NewComposedFilter takes a list of Filters and returns a new Filter that is a composition of all input filters running sequentially from left to right
func NewFieldInjectorFilter ¶
NewFieldInjectorFilter takes a list of fields and returnas a filter that inject those fields on every measure received
func NewFilter ¶
func NewFilter(adapter FilterAdapter, finalizer FinalizeAdapter) (Filter, error)
NewFilter takes and adapter that implements filter logic and returns a brand new filter to be used in pipelines
func NewLogFilter ¶
NewLogFilter takes a label and returns a Filters that prints out every Measure, tagged with the label, on console output
func NewMeasureCountFilter ¶
NewMeasureCountFilter counts the number of inputed measures
func NewNameInjectorFilter ¶
NewNameInjectorFilter takes a name and returns a Filter that inject that name on every measure received
func NewNameSanityFilter ¶
NewNameSanityFilter takes a name and returns a Filter that inject that name on every measure received
func NewTagInjectorFilter ¶
NewTagInjectorFilter takes a list of tags and returns a Filter that inject those tags on every measure received
func NewTimeInjectorFilter ¶
NewTimeInjectorFilter takes a time and returns a Filter that inject that time on every measure received
type FilterAdapter ¶
type FilterAdapter func(Feedback, *Measure, MeasureWriter)
FilterAdapter takes a Feedback, a Measure pointer and a MeasureWriter and Create a filter using Measure as input Write down filtered Measure information on MeasureWriter Use Feedback funtion to inform about any errors or debug information
type FilteredInput ¶
FilteredInput composes a Input and a Filter and returns an Input function
type FilteredOutput ¶
FilteredOutput composes a Input and a Filter and returns an Input function
type FinalizeAdapter ¶
type FinalizeAdapter func(Feedback, MeasureWriter)
FinalizeAdapter is a function called when filter stream has been closed
type Helpers ¶
type Helpers struct { IOPipe func() (*io.PipeReader, *io.PipeWriter) IOcopy func(io.Writer, io.Reader) NewWriter func(io.Writer) MeasureWriter NewReader func(io.Reader) MeasureReader }
Helpers is a struct with Helper functions to be used inside components
type IOPipeline ¶
IOPipeline takes an input, a filter and an output
type Input ¶
type Input func(Feedback) (MeasureReader, error)
Input takes a Feedback and returns a reader
func NewComposedInput ¶
NewComposedInput composes a source and a encoder
func NewFilteredInput ¶
NewFilteredInput composes a Input and a Filter and returns an Input function
func NewInputFromProducer ¶
func NewInputFromProducer(producer func(f Feedback, w MeasureWriter)) (Input, error)
NewInputFromProducer takes a producer function and returns an Input function
func NewMergedInput ¶
NewMergedInput takes a list of inputs and merges it in a single input
type Measure ¶
type Measure struct { Name string `json:"name"` Tags []Tag `json:"tags,omitempty"` Flds []Field `json:"flds"` Time int64 `json:"time"` }
Measure is the single unit of data we pass through systems
func (*Measure) FieldValue ¶
FieldValue returns the value of a field
func (*Measure) InsertOrUpdateTag ¶ added in v0.1.3
InsertOrUpdateTag does the insertion or the update of a tag
type MeasureReader ¶
MeasureReader takes a Measure pointer, modifies it and return error if any
type MeasureWriter ¶
MeasureWriter takes a Measure struct, send it to any kind of transportation and return am error if any
type MergedInput ¶
MergedInput takes a list of inputs and merges it in a single input
type MergedOutput ¶
MergedOutput takes a list of outputs and returns a single output function
type Output ¶
type Output func(Feedback, MeasureReader) error
Output takes a Feedback and a Reader and outputs to whatever place
func NewComposedOutput ¶
NewComposedOutput is
func NewFilteredOutput ¶
NewFilteredOutput composes a Input and a Filter and returns an Input function
func NewMergedOutput ¶
NewMergedOutput takes a list of outputs and returns a single output function
type Runnable ¶
Runnable takes a Feedback function and runs whatever logic inside and returns an error if any
type Sinker ¶
type Sinker func(Feedback, io.ReadCloser) error
Sinker takes a Feedback function and a generic Reader and returns an error if any Sinker should send the received data to other systems Initialization errors should be returned using the error object Runtime errors should be send to the Feedback function.
func NewBasicHTTPSinker ¶
NewBasicHTTPSinker is
func NewWriteCloserSinker ¶
func NewWriteCloserSinker(out io.WriteCloser) (Sinker, error)
NewWriteCloserSinker takes
type Source ¶
type Source func(Feedback) (io.ReadCloser, error)
Source takes a Feedback function, get data from whatever source and returns that data in a io.ReadCloser object Initialization errors should be returned using the error object Runtime errors should be send to the Feedback function.
func NewBasicHTTPSource ¶
NewBasicHTTPSource is a basic HTTP Source
func NewSource ¶
func NewSource(adapter SourceAdapter) (Source, error)
NewSource returns a NewSource component using a getter function as its input stream