agent

package
v0.0.0-...-11eb28e Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const SiloProjectName string = "silo-client-services"

SiloProjectName is the const name of the "project" we will run through libcompose

Variables

Project that this silo-agent is working with

View Source
var ServicesHaveBeenStarted = false

ServicesHaveBeenStarted Declares if any services have been started on this silo agent

View Source
var WorkQueue = make(chan Work, 100)

WorkQueue is a buffered channel that we can send work requests on

View Source
var WorkerQueue chan chan Work

WorkerQueue defines the interface for workers to read from, a channel of work channels

Functions

func KillAgent

func KillAgent(logger *logrus.Logger) error

KillAgent kills the current project

func StartAgent

func StartAgent(dockerComposePath string, logger *logrus.Logger) (queue chan Work)

StartAgent will spin up the docker stack specified by the given compose file

Types

type ConfigUpdate

type ConfigUpdate struct {
	ConfigType string
	Config     []byte
}

ConfigUpdate struct contains data to update the running contianers on the system

type Work

type Work struct {
	Name  string
	Data  json.RawMessage
	Delay time.Duration
}

Work struct defines the basic format for all work processed by the agent Data is an encoded JSON raw message and is decoded based upon the given name

type Worker

type Worker struct {
	ID          int
	Work        chan Work
	WorkerQueue chan chan Work
	QuitChan    chan bool
}

Worker struct defines and holds the state of a given worker

func NewWorker

func NewWorker(id int, workerQueue chan chan Work) Worker

NewWorker creates, and returns a new Worker object. Its only argument is a channel that the worker can add itself to whenever it is done its work.

func (*Worker) Start

func (w *Worker) Start(logger *logrus.Logger)

Start begins the goroutine infinite for

Jump to

Keyboard shortcuts

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