worker

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2018 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package worker contains the core of the autodeb worker. It creates all dependencies injects them at the right place.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServerURL        string    `toml:"server_url"`
	AccessToken      string    `toml:"access_token"`
	WorkingDirectory string    `toml:"working_directory"`
	LogLevel         log.Level `toml:"log_level"`
	RunnerCount      int       `toml:"runner_count"`
}

Config contains configuration for Worker

func ParseConfig added in v0.9.0

func ParseConfig(filepath string, fs filesystem.FS) (*Config, error)

ParseConfig parses a configuration file to create a worker config

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

Worker is the autodeb worker. It retrieves jobs from the main server and passes them to JobRunners that will execute them.

Workers are not safe for use by multiple goroutines.

func New

func New(cfg *Config, loggingOutput io.Writer) (*Worker, error)

New creates a Worker

func (*Worker) Shutdown added in v0.4.0

func (w *Worker) Shutdown() error

Shutdown stop the worker gracefully.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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