Documentation
¶
Overview ¶
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Index ¶
- Constants
- type CCMessage
- func EmptyMessage() CCMessage
- func FromBytes(data []byte) ([]CCMessage, error)
- func FromInfluxMetric(other lp1.Metric) CCMessage
- func FromJSON(input json.RawMessage) (CCMessage, error)
- func FromMessage(other CCMessage) CCMessage
- func NewEvent(name string, tags map[string]string, meta map[string]string, event string, ...) (CCMessage, error)
- func NewGetControl(name string, tags map[string]string, meta map[string]string, tm time.Time) (CCMessage, error)
- func NewJobStartEvent(job *schema.Job) (CCMessage, error)
- func NewJobStopEvent(job *schema.Job) (CCMessage, error)
- func NewLog(name string, tags map[string]string, meta map[string]string, log string, ...) (CCMessage, error)
- func NewMessage(name string, tags map[string]string, meta map[string]string, ...) (CCMessage, error)
- func NewMetric(name string, tags map[string]string, meta map[string]string, value interface{}, ...) (CCMessage, error)
- func NewPutControl(name string, tags map[string]string, meta map[string]string, value string, ...) (CCMessage, error)
- func NewQuery(name string, tags map[string]string, meta map[string]string, q string, ...) (CCMessage, error)
- type CCMessageType
Constants ¶
const ( CCMSG_TYPE_METRIC = iota CCMSG_TYPE_EVENT CCMSG_TYPE_LOG CCMSG_TYPE_CONTROL )
const ( MIN_CCMSG_TYPE = CCMSG_TYPE_METRIC MAX_CCMSG_TYPE = CCMSG_TYPE_CONTROL CCMSG_TYPE_INVALID = MAX_CCMSG_TYPE + 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CCMessage ¶
type CCMessage interface { ToPoint(metaAsTags map[string]bool) *write.Point // Generate influxDB point for data type ccMessage ToLineProtocol(metaAsTags map[string]bool) string // Generate influxDB line protocol for data type ccMessage ToJSON(metaAsTags map[string]bool) (json.RawMessage, error) Name() string // Get metric name SetName(name string) // Set metric name Time() time.Time // Get timestamp SetTime(t time.Time) // Set timestamp Tags() map[string]string // Map of tags AddTag(key, value string) // Add a tag GetTag(key string) (value string, ok bool) // Get a tag by its key HasTag(key string) (ok bool) // Check if a tag key is present RemoveTag(key string) // Remove a tag by its key Meta() map[string]string // Map of meta data tags AddMeta(key, value string) // Add a meta data tag GetMeta(key string) (value string, ok bool) // Get a meta data tab addressed by its key HasMeta(key string) (ok bool) // Check if a meta data key is present RemoveMeta(key string) // Remove a meta data tag by its key Fields() map[string]interface{} // Map of fields AddField(key string, value interface{}) // Add a field GetField(key string) (value interface{}, ok bool) // Get a field addressed by its key HasField(key string) (ok bool) // Check if a field key is present RemoveField(key string) // Remove a field addressed by its key String() string // Return line-protocol like string MessageType() CCMessageType // Return message type IsMetric() bool GetMetricValue() interface{} IsLog() bool GetLogValue() string IsEvent() bool GetEventValue() string IsControl() bool GetControlValue() string GetControlMethod() string }
ccMessage access functions
func EmptyMessage ¶
func EmptyMessage() CCMessage
func FromInfluxMetric ¶
FromInfluxMetric copies the influxDB line protocol metric <other>
func NewGetControl ¶
func NewMessage ¶
func NewMessage( name string, tags map[string]string, meta map[string]string, fields map[string]interface{}, tm time.Time, ) (CCMessage, error)
New creates a new measurement point
func NewPutControl ¶
type CCMessageType ¶
type CCMessageType int
func (CCMessageType) FieldKey ¶
func (t CCMessageType) FieldKey() string
func (CCMessageType) String ¶
func (t CCMessageType) String() string