work

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransmitResponseErr int = -1
	TransmitResponseOK  int = 0
)

Variables

This section is empty.

Functions

func NewDBusError

func NewDBusError(name string, body ...string) *dbus.Error

func ScrubName

func ScrubName(name string) (string, error)

ScrubName cleans up invalid bus names to ensure D-Bus name specification conformance. An error is returned along with the scrubbed value if the name contained invalid characters.

Types

type Dispatcher

type Dispatcher struct {
	HTTPClient *internalhttp.Client

	MessageJournal *messagejournal.MessageJournal
	Dispatchers    chan map[string]map[string]string
	WorkerEvents   chan ipc.WorkerEvent
	Inbound        chan yggdrasil.Data
	Outbound       chan struct {
		Data yggdrasil.Data
		Resp chan yggdrasil.Response
	}
	// contains filtered or unexported fields
}

Dispatcher implements the com.redhat.Yggdrasil1.Dispatcher1 D-Bus interface and is suitable to be exported onto a bus.

Dispatcher receives values on its 'inbound' channel and sends them via D-Bus to the destination worker. It sends values on the 'outbound' channel to relay data received from workers to a remote address.

func NewDispatcher

func NewDispatcher(client *internalhttp.Client) *Dispatcher

func (*Dispatcher) CancelMessage

func (d *Dispatcher) CancelMessage(directive, message_id, cancel_id string) error

CancelMessage implements the dispatching of a cancel message to the worker.

func (*Dispatcher) Connect

func (d *Dispatcher) Connect() error

Connect connects the dispatcher to an appropriate D-Bus broker and begins processing messages received on the inbound channel.

func (*Dispatcher) DisconnectWorkers

func (d *Dispatcher) DisconnectWorkers()

func (*Dispatcher) Dispatch

func (d *Dispatcher) Dispatch(data yggdrasil.Data) error

func (*Dispatcher) EmitEvent

func (d *Dispatcher) EmitEvent(event ipc.DispatcherEvent) error

func (*Dispatcher) FlattenDispatchers

func (d *Dispatcher) FlattenDispatchers() map[string]map[string]string

func (*Dispatcher) Transmit

func (d *Dispatcher) Transmit(
	sender dbus.Sender,
	addr string,
	messageID string,
	responseTo string,
	metadata map[string]string,
	data []byte,
) (responseCode int, responseMetadata map[string]string, responseData []byte, responseError *dbus.Error)

Transmit implements the com.redhat.Yggdrasil1.Dispatcher1.Transmit method.

Jump to

Keyboard shortcuts

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