Documentation
¶
Index ¶
- type Backend
- type DefaultTransportConfiguration
- type FlatOperation
- type Flattener
- type FlattenerConfig
- type FlattenerPoint
- type HTTPTransport
- func (t *HTTPTransport) AddJSONMapping(name string, p interface{}, variables ...string) error
- func (t *HTTPTransport) Close()
- func (t *HTTPTransport) ConfigureBackend(backend *Backend) error
- func (t *HTTPTransport) DataChannel() chan<- interface{}
- func (t *HTTPTransport) DataChannelItemToFlattenedPoint(operation FlatOperation, instance interface{}) (*FlattenerPoint, error)
- func (t *HTTPTransport) FlattenedPointToDataChannelItem(point *FlattenerPoint) (interface{}, error)
- func (t *HTTPTransport) MatchType(tt transportType) bool
- func (t *HTTPTransport) Serialize(item interface{}) (string, error)
- func (t *HTTPTransport) Start() error
- func (t *HTTPTransport) TransferData(dataList []interface{}) error
- type HTTPTransportConfig
- type Manager
- func (m *Manager) FlattenHTTP(operation FlatOperation, name string, parameters ...interface{}) error
- func (m *Manager) FlattenOpenTSDB(operation FlatOperation, value float64, timestamp int64, metric string, ...) error
- func (m *Manager) GetTransport() Transport
- func (m *Manager) SendHTTP(schemaName string, parameters ...interface{}) error
- func (m *Manager) SendOpenTSDB(value float64, timestamp int64, metric string, tags ...interface{}) error
- func (m *Manager) SerializeHTTP(schemaName string, parameters ...interface{}) (string, error)
- func (m *Manager) SerializeOpenTSDB(value float64, timestamp int64, metric string, tags ...interface{}) (string, error)
- func (m *Manager) Shutdown()
- func (m *Manager) Start() error
- type NumberPoint
- type OpenTSDBTransport
- func (t *OpenTSDBTransport) Close()
- func (t *OpenTSDBTransport) ConfigureBackend(backend *Backend) error
- func (t *OpenTSDBTransport) DataChannel() chan<- interface{}
- func (t *OpenTSDBTransport) DataChannelItemToFlattenedPoint(operation FlatOperation, instance interface{}) (*FlattenerPoint, error)
- func (t *OpenTSDBTransport) FlattenedPointToDataChannelItem(point *FlattenerPoint) (interface{}, error)
- func (t *OpenTSDBTransport) MatchType(tt transportType) bool
- func (t *OpenTSDBTransport) Serialize(item interface{}) (string, error)
- func (t *OpenTSDBTransport) Start() error
- func (t *OpenTSDBTransport) TransferData(dataList []interface{}) error
- type OpenTSDBTransportConfig
- type Point
- type TextPoint
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultTransportConfiguration ¶
type DefaultTransportConfiguration struct {
TransportBufferSize int
BatchSendInterval time.Duration
RequestTimeout time.Duration
SerializerBufferSize int
}
DefaultTransportConfiguration - the default fields used by the transport configuration
func (*DefaultTransportConfiguration) Validate ¶
func (c *DefaultTransportConfiguration) Validate() error
Validate - validates the default itens from the configuration
type FlatOperation ¶
type FlatOperation uint8
FlatOperation - the type of the aggregation used
const ( // Avg - aggregation Avg FlatOperation = 0 // Sum - aggregation Sum FlatOperation = 1 // Count - aggregation Count FlatOperation = 2 // Max - aggregation Max FlatOperation = 3 // Min - aggregation Min FlatOperation = 4 )
type Flattener ¶
type Flattener struct {
// contains filtered or unexported fields
}
Flattener - controls the timeline's point flattening
func NewFlattener ¶
func NewFlattener(transport Transport, configuration *FlattenerConfig) (*Flattener, error)
NewFlattener - creates a new flattener
func (*Flattener) Add ¶
func (f *Flattener) Add(point *FlattenerPoint) error
Add - adds a new entry to the flattening process
type FlattenerConfig ¶
FlattenerConfig - flattener configuration
type FlattenerPoint ¶
type FlattenerPoint struct {
// contains filtered or unexported fields
}
FlattenerPoint - a flattener's point containing the value
type HTTPTransport ¶
type HTTPTransport struct {
// contains filtered or unexported fields
}
HTTPTransport - implements the HTTP transport
func NewHTTPTransport ¶
func NewHTTPTransport(configuration *HTTPTransportConfig) (*HTTPTransport, error)
NewHTTPTransport - creates a new HTTP event manager
func (*HTTPTransport) AddJSONMapping ¶
func (t *HTTPTransport) AddJSONMapping(name string, p interface{}, variables ...string) error
AddJSONMapping - overrides the default generic property mappings
func (*HTTPTransport) ConfigureBackend ¶
func (t *HTTPTransport) ConfigureBackend(backend *Backend) error
ConfigureBackend - configures the backend
func (*HTTPTransport) DataChannel ¶
func (t *HTTPTransport) DataChannel() chan<- interface{}
DataChannel - send a new point
func (*HTTPTransport) DataChannelItemToFlattenedPoint ¶
func (t *HTTPTransport) DataChannelItemToFlattenedPoint(operation FlatOperation, instance interface{}) (*FlattenerPoint, error)
DataChannelItemToFlattenedPoint - converts the data channel item to the flattened point one
func (*HTTPTransport) FlattenedPointToDataChannelItem ¶
func (t *HTTPTransport) FlattenedPointToDataChannelItem(point *FlattenerPoint) (interface{}, error)
FlattenedPointToDataChannelItem - converts the flattened point to the data channel one
func (*HTTPTransport) MatchType ¶
func (t *HTTPTransport) MatchType(tt transportType) bool
MatchType - checks if this transport implementation matches the given type
func (*HTTPTransport) Serialize ¶
func (t *HTTPTransport) Serialize(item interface{}) (string, error)
Serialize - renders the text using the configured serializer
func (*HTTPTransport) TransferData ¶
func (t *HTTPTransport) TransferData(dataList []interface{}) error
TransferData - transfers the data to the backend throught this transport
type HTTPTransportConfig ¶
type HTTPTransportConfig struct {
DefaultTransportConfiguration
ServiceEndpoint string
Method string
ExpectedResponseStatus int
TimestampProperty string
ValueProperty string
}
HTTPTransportConfig - has all HTTP event manager configurations
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager - the parent of all event managers
func NewManager ¶
NewManager - creates a timeline manager
func NewManagerF ¶
NewManagerF - creates a timeline manager with flattener
func (*Manager) FlattenHTTP ¶
func (m *Manager) FlattenHTTP(operation FlatOperation, name string, parameters ...interface{}) error
FlattenHTTP - flatten a point
func (*Manager) FlattenOpenTSDB ¶
func (m *Manager) FlattenOpenTSDB(operation FlatOperation, value float64, timestamp int64, metric string, tags ...interface{}) error
FlattenOpenTSDB - flatten a point
func (*Manager) GetTransport ¶
GetTransport - returns the configured transport
func (*Manager) SendOpenTSDB ¶
func (m *Manager) SendOpenTSDB(value float64, timestamp int64, metric string, tags ...interface{}) error
SendOpenTSDB - sends a new data using the openTSDB transport
func (*Manager) SerializeHTTP ¶
SerializeHTTP - serializes a point using the json serializer
type NumberPoint ¶
NumberPoint - a point with number type value
type OpenTSDBTransport ¶
type OpenTSDBTransport struct {
// contains filtered or unexported fields
}
OpenTSDBTransport - implements the openTSDB transport
func NewOpenTSDBTransport ¶
func NewOpenTSDBTransport(configuration *OpenTSDBTransportConfig) (*OpenTSDBTransport, error)
NewOpenTSDBTransport - creates a new openTSDB event manager
func (*OpenTSDBTransport) ConfigureBackend ¶
func (t *OpenTSDBTransport) ConfigureBackend(backend *Backend) error
ConfigureBackend - configures the backend
func (*OpenTSDBTransport) DataChannel ¶
func (t *OpenTSDBTransport) DataChannel() chan<- interface{}
DataChannel - send a new point
func (*OpenTSDBTransport) DataChannelItemToFlattenedPoint ¶
func (t *OpenTSDBTransport) DataChannelItemToFlattenedPoint(operation FlatOperation, instance interface{}) (*FlattenerPoint, error)
DataChannelItemToFlattenedPoint - converts the data channel item to the flattened point one
func (*OpenTSDBTransport) FlattenedPointToDataChannelItem ¶
func (t *OpenTSDBTransport) FlattenedPointToDataChannelItem(point *FlattenerPoint) (interface{}, error)
FlattenedPointToDataChannelItem - converts the flattened point to the data channel one
func (*OpenTSDBTransport) MatchType ¶
func (t *OpenTSDBTransport) MatchType(tt transportType) bool
MatchType - checks if this transport implementation matches the given type
func (*OpenTSDBTransport) Serialize ¶
func (t *OpenTSDBTransport) Serialize(item interface{}) (string, error)
Serialize - renders the text using the configured serializer
func (*OpenTSDBTransport) Start ¶
func (t *OpenTSDBTransport) Start() error
Start - starts this transport
func (*OpenTSDBTransport) TransferData ¶
func (t *OpenTSDBTransport) TransferData(dataList []interface{}) error
TransferData - transfers the data to the backend throught this transport
type OpenTSDBTransportConfig ¶
type OpenTSDBTransportConfig struct {
DefaultTransportConfiguration
MaxReadTimeout time.Duration
ReconnectionTimeout time.Duration
}
OpenTSDBTransportConfig - has all openTSDB event manager configurations
type Point ¶
type Point struct {
Metric string `json:"metric"`
Tags map[string]string `json:"tags"`
Timestamp int64 `json:"timestamp"`
}
Point - the base point
type Transport ¶
type Transport interface {
// Send - send a new point
DataChannel() chan<- interface{}
// ConfigureBackend - configures the backend
ConfigureBackend(backend *Backend) error
// TransferData - transfers the data using this specific implementation
TransferData(dataList []interface{}) error
// Start - starts this transport
Start() error
// Close - closes this transport
Close()
// MatchType - checks if this transport implementation matches the given type
MatchType(tt transportType) bool
// DataChannelItemToFlattenedPoint - converts the data channel item to the flattened point one
DataChannelItemToFlattenedPoint(operation FlatOperation, item interface{}) (*FlattenerPoint, error)
// FlattenedPointToDataChannelItem - converts the flattened point to the data channel item one
FlattenedPointToDataChannelItem(point *FlattenerPoint) (interface{}, error)
// Serialize - renders the text using the configured serializer
Serialize(item interface{}) (string, error)
}
Transport - the implementation type to send a event