Documentation ¶
Index ¶
- func GUIDNew() string
- func Mapkey(m map[string]string, value string) (key string, ok bool)
- func SerializeObject(obj interface{}) (string, error)
- func ToBool(val interface{}) (bool, error)
- type AMQPExchange
- func (exch *AMQPExchange) Close() error
- func (exch *AMQPExchange) Open(isQueued bool) error
- func (exch *AMQPExchange) PrepareReceiveFunc(f func(msgs <-chan amqp.Delivery)) error
- func (exch *AMQPExchange) Publish(body string) error
- func (exch *AMQPExchange) PublishObject(obj interface{}) error
- func (exch *AMQPExchange) ReadMessages() ([]string, error)
- type AnalyticsArg
- type AnalyticsRequest
- type AnalyticsResponse
- type KXHistTSRecord
- type KXRTPObject
- type KXScanMessageUnitType
- type Quality
- type RTDB
- func (rtdb *RTDB) CloseRTDB() error
- func (rtdb *RTDB) GetRTPObject(key string) (KXRTPObject, error)
- func (rtdb *RTDB) GetValueFromKey(key string) (string, error)
- func (rtdb *RTDB) IsRTDBConnected() bool
- func (rtdb *RTDB) OpenRTDB() error
- func (rtdb *RTDB) RTDBNew(hostName string, port int, userName string, password string, defaultDB int, ...)
- func (rtdb *RTDB) SetValueForKey(key string, value string) error
- func (rtdb *RTDB) UpdateRTPObject(key string, rtpObject KXRTPObject) error
- type RtAvg
- type RtVal
- type ScanMessage
- type ScanMessageUnit
- type TSDB
- func (tsdb *TSDB) CloseTSDB() error
- func (tsdb *TSDB) OpenTSDB() error
- func (tsdb *TSDB) QueryTSOneTagLastValue(database string, table string, tag string, endTimeStamp time.Time) (map[string]interface{}, error)
- func (tsdb *TSDB) QueryTSOneTagTimeRange(database string, table string, tag string, startTimeStamp time.Time, ...) ([]map[string]interface{}, error)
- type TSRecord
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SerializeObject ¶
Types ¶
type AMQPExchange ¶
type AMQPExchange struct { Uri string HostName string ExchangeName string ExchangeType string QueueName string RoutingKey string UserName string Password string Durable bool AutoDelete bool Reliable bool Connection *amqp.Connection Channel *amqp.Channel Queue *amqp.Queue Messages []string Confirms chan amqp.Confirmation IsOpen bool }
AMQPExchange contains all parameters required to create or open an exchenge
func AMQPExchangeNew ¶
func AMQPExchangeNew(hostName string, port int, exchangeName string, exchangeType string, queueName string, routingKey string, userName string, password string, durable bool, autoDelete bool, reliable bool) *AMQPExchange
AMQPExchangeNew creates a new exchange in the Broker
func (*AMQPExchange) Open ¶
func (exch *AMQPExchange) Open(isQueued bool) error
Open opens a previosly created Exchange
func (*AMQPExchange) PrepareReceiveFunc ¶
func (exch *AMQPExchange) PrepareReceiveFunc(f func(msgs <-chan amqp.Delivery)) error
PrepareReceiveFunc Prepares exchange/queue to receive messages
func (*AMQPExchange) Publish ¶
func (exch *AMQPExchange) Publish(body string) error
Publish publishes a new message into an existing exchange
func (*AMQPExchange) PublishObject ¶
func (exch *AMQPExchange) PublishObject(obj interface{}) error
PublishObject serializes objects (JSON) and publish to existing exchange
func (*AMQPExchange) ReadMessages ¶
func (exch *AMQPExchange) ReadMessages() ([]string, error)
ReadMessages reads the messajes accumulated in the queue
type AnalyticsArg ¶
AnalyticsArg argument into the request
func AnalyticsArgNew ¶
func AnalyticsArgNew(name string, value string, quality string) AnalyticsArg
type AnalyticsRequest ¶
type AnalyticsRequest struct { Function string Args []AnalyticsArg }
AnalyticsRequest main request to analytic calculation
func AnalyticsRequestNew ¶
func AnalyticsRequestNew(function string, args []AnalyticsArg) AnalyticsRequest
type AnalyticsResponse ¶
type AnalyticsResponse struct { Results []AnalyticsArg Success bool }
type KXHistTSRecord ¶
type KXHistTSRecord struct { Tag string PType string Value float64 ValueStr string Quality string TimeStamp time.Time }
KXHistTSRecord defines the structure of the time series record in TSDB
type KXRTPObject ¶
KXRTPObject configuration structure for Physical Objects
func DecodeUpdateMessage ¶
func DecodeUpdateMessage(message string) (KXRTPObject, error)
DecodeUpdateMessage get messages coming from a KXDataProc
func (*KXRTPObject) Deserialize ¶
func (rtpObject *KXRTPObject) Deserialize(jsonInput string) error
Deserialize - attempt to convert a Json to RTKXPObject
func (*KXRTPObject) Serialize ¶
func (rtpObject *KXRTPObject) Serialize() (string, error)
Serialize - convert a RTKXPObject to Json
type KXScanMessageUnitType ¶
type KXScanMessageUnitType int
const ( MessageUnitTypeValue KXScanMessageUnitType = iota MessageUnitTypeQuality MessageUnitTypeUnknown )
func (KXScanMessageUnitType) String ¶
func (scanMessageUnitQuality KXScanMessageUnitType) String() string
type RTDB ¶
type RTDB struct {
// contains filtered or unexported fields
}
RTDB Real Time DB Class
func (*RTDB) GetRTPObject ¶
func (rtdb *RTDB) GetRTPObject(key string) (KXRTPObject, error)
GetRTPObject get RTpObject form RTDB (if exists)
func (*RTDB) GetValueFromKey ¶
GetValueFromKey queries a value from key
func (*RTDB) IsRTDBConnected ¶
IsRTDBConnected checks if RTDB is connected
func (*RTDB) RTDBNew ¶
func (rtdb *RTDB) RTDBNew(hostName string, port int, userName string, password string, defaultDB int, jsonField string)
RTDBNew creates a new RT DB connection object
func (*RTDB) SetValueForKey ¶
SetValueForKey updates db value for a key
func (*RTDB) UpdateRTPObject ¶
func (rtdb *RTDB) UpdateRTPObject(key string, rtpObject KXRTPObject) error
UpdateRTPObject updates RTPObject into RTDB
type ScanMessage ¶
type ScanMessage struct { MID string Payload []ScanMessageUnit }
ScanMessage holds a group of new data sent from any scanner to the data processor
func (*ScanMessage) ScanMessageAdd ¶
func (sm *ScanMessage) ScanMessageAdd(smu ScanMessageUnit)
ScanMessageAdd Add a new ScanMessageUnit to existing ScanMessage
type ScanMessageUnit ¶
type ScanMessageUnit struct { ID int Tag string Value string Quality string MType KXScanMessageUnitType TimeStamp time.Time }
ScanMessageUnit contains a single new value to be sent to the data processor
func ScanMessageUnitNew ¶
func ScanMessageUnitNew(pOID int, tag string, value string, quality string, mType KXScanMessageUnitType, timeStamp time.Time) ScanMessageUnit
ScanMessageUnitNew creates a new scan message Unit
type TSDB ¶
type TSDB struct {
// contains filtered or unexported fields
}
TSDB Time Series DB Class