comms

package
v0.0.0-...-56a9bdf Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgentComms

func NewAgentComms(cfg config.Config, ac *cache.AgentCache) (*toddComms, error)

NewAgentComms returns a comms instance configured for agent usages.

TODO: accept an interface for cache instead of concrete type

func NewToDDComms

func NewToDDComms(cfg config.Config) (*toddComms, error)

NewToDDComms will create a new instance of toddComms, and load the desired CommsPackage-compatible comms package into it.

Types

type Package

type Package interface {

	// (agent advertisement to advertise)
	AdvertiseAgent(defs.AgentAdvert) error

	// (map of assets:hashes, base asset URL)
	ListenForAgent(assetProvider, string) error

	// (uuid)
	ListenForTasks(string) error

	// (queuename, task)
	SendTask(string, tasks.Task) error

	// watches for new group membership instructions in the cache and reregisters
	WatchForGroup() error

	ListenForGroupTasks(string, chan bool) error

	ListenForResponses(*chan bool) error
	SendResponse(responses.Response) error
	// contains filtered or unexported methods
}

Package will ensure that whatever specific comms struct is loaded at compile time will support all of the necessary features/functions that we need to make ToDD work. In short, this interface represents a list of things that the server and agents do on the message queue.

Jump to

Keyboard shortcuts

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