minion

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2016 License: BSD-2-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const EtcdMinionSpace = "/gru/minion"

EtcdMinionSpace is the keyspace in etcd used by minions

Variables

View Source
var ErrNoSiteRepo = errors.New("No site repo configured")

ErrNoSiteRepo is returned when the minion is not configured with a site repo

Functions

func EtcdUnmarshalTask

func EtcdUnmarshalTask(node *etcdclient.Node) (*task.Task, error)

EtcdUnmarshalTask unmarshals tasks from an etcd node

Types

type EtcdMinionConfig added in v0.2.0

type EtcdMinionConfig struct {
	// Number of goroutines used for concurrent resource processing
	Concurrency int

	// Name of the minion
	Name string

	// SiteRepo specifies the path/url to the upstream repo
	SiteRepo string

	// EtcdConfig provides etcd-related configuration settings
	EtcdConfig etcdclient.Config
}

EtcdMinionConfig contains configuration settings for minions which use the etcd backend implementation

type Minion

type Minion interface {
	// ID returns the unique identifier of a minion
	ID() uuid.UUID

	// SetName sets the name of the minion
	SetName(string) error

	// SetLastseen sets the time the minion was last seen
	SetLastseen(int64) error

	// SetClassifier sets a classifier for the minion
	SetClassifier(*classifier.Classifier) error

	// TaskListener listens for new tasks and processes them
	TaskListener(c chan<- *task.Task) error

	// TaskRunner runs new tasks as received by the TaskListener
	TaskRunner(c <-chan *task.Task) error

	// SaveTaskResult saves the result of a task
	SaveTaskResult(t *task.Task) error

	// Sync syncs modules and data files
	Sync() error

	// Serve start the minion
	Serve() error

	// Stop stops the minion
	Stop() error
}

Minion interface type

func NewEtcdMinion

func NewEtcdMinion(config *EtcdMinionConfig) (Minion, error)

NewEtcdMinion creates a new minion with etcd backend

Jump to

Keyboard shortcuts

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