databus

package
v0.0.0-...-6f62517 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STARTING    = "Starting"
	RUNNING     = "Running"
	TELNOTFOUND = "Telemetry Service Not Found"
	CONNFAILED  = "Connection Failed"
)
View Source
const (
	GET            = "get"
	SUBSCRIBE      = "subscribe"
	GETPRODUCERS   = "getproducers"
	DELETEPRODUCER = "deleteproducers"
	TERMINATE      = "terminate"
)
View Source
const CommandQueue = "/databus"

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Command      string `json:"command"`
	ReceiveQueue string `json:"ReceiveQueue"`
	ReportData   string `json:"reportdata,omitempty"`
	ServiceIP    string `json:"serviceIP,omitempty"`
}

type DataBusClient

type DataBusClient struct {
	Bus messagebus.Messagebus
}

func (*DataBusClient) DeleteProducer

func (d *DataBusClient) DeleteProducer(queue string, service auth.Service)

func (*DataBusClient) Get

func (d *DataBusClient) Get(queue string)

func (*DataBusClient) GetGroup

func (d *DataBusClient) GetGroup(groups chan<- *DataGroup, queue string)

func (*DataBusClient) GetProducers

func (d *DataBusClient) GetProducers(queue string) []DataProducer

func (*DataBusClient) GetResponse

func (d *DataBusClient) GetResponse(queue string) *Response

func (*DataBusClient) ReadOneMessage

func (d *DataBusClient) ReadOneMessage(queue string) string

func (*DataBusClient) SendCommand

func (d *DataBusClient) SendCommand(command Command)

func (*DataBusClient) Subscribe

func (d *DataBusClient) Subscribe(queue string)

type DataBusService

type DataBusService struct {
	Recievers []string
	Bus       messagebus.Messagebus
}

func (*DataBusService) ReceiveCommand

func (d *DataBusService) ReceiveCommand(commands chan<- *Command) error

func (*DataBusService) SendGroup

func (d *DataBusService) SendGroup(group DataGroup)

func (*DataBusService) SendGroupToQueue

func (d *DataBusService) SendGroupToQueue(group DataGroup, queue string)

func (*DataBusService) SendMultipleResponses

func (d *DataBusService) SendMultipleResponses(command string, dataType string, data interface{})

func (*DataBusService) SendProducersToQueue

func (d *DataBusService) SendProducersToQueue(producer []*DataProducer, queue string) error

func (*DataBusService) SendResponse

func (d *DataBusService) SendResponse(queue string, command string, dataType string, data interface{}) error

type DataGroup

type DataGroup struct {
	ID       string
	Label    string
	Sequence string
	Values   []DataValue
}

type DataProducer

type DataProducer struct {
	Hostname  string
	Username  string
	State     string
	LastEvent time.Time
}

type DataValue

type DataValue struct {
	ID                        string
	Context                   string
	Label                     string
	Value                     string
	System                    string
	Timestamp                 string
	MessageId                 string
	EventType                 string
	MaxBandwidthPercent       float64
	MinBandwidthPercent       float64
	DiscardedPkts             float64
	RxBroadcast               float64
	RxBytes                   float64
	RxErrorPktAlignmentErrors float64
	RxMulticastPackets        float64
	RxUnicastPackets          float64
	TxBroadcast               float64
	TxBytes                   float64
	TxMutlicastPackets        float64
	TxUnicastPackets          float64
}

type Response

type Response struct {
	Command  string      `json:"command"`
	DataType string      `json:"dataType"`
	Data     interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL