databus

package
v0.0.0-...-e86fecb Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 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
	System    string
	HostName  string
	Model     string
	SKU       string
	FQDN      string
	FwVer     string
	ImgID     string
	Timestamp string
	Values    []DataValue
	Events    []EventValue
}

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
	HostName  string
	Timestamp string
}

type EventValue

type EventValue struct {
	EventType         string
	EventId           string
	EventTimestamp    string
	MemberId          string
	MessageSeverity   string
	Message           string
	MessageId         string
	MessageArgs       []string
	OriginOfCondition string
}

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