config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2015 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package config provides functionality to read and parse the Goophry configuration file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	RedisNetwork     string // network type used for the connection to Redis
	RedisAddress     string // network address used for the connection to Redis
	RedisQueueKey    string // first part of the list-names used in Redis
	Tasks            []Task // list of available tasks that Goophry can execute
	ErrorScript      string // path to script/application that is executed when a task created an error
	FailedTasksTTL   int    // ttl for the lists that store failed tasks
	Logfile          string // a file where all output will be written to, instead of stdout
	StatsInterface   string // the interface where statistics from Goophry can be gathered from
	StatsPattern     string // the pattern where the http-server will respond on
	StatsTLSCertFile string // the certificate file used, to serve the statistics over https
	StatsTLSKeyFile  string // the private key file used, to serve the statistics over https
}

A Config stores values, necessary for the execution of Goophry.

func NewConfig

func NewConfig(path string) (c Config, err error)

NewConfig reads the provided file and returns a Config instance with the values from it. It may also return an error, when the file doesn't exist, or the content could not be parsed.

type Task

type Task struct {
	Type    string // second part of the list-names used in Redis and used to identify tasks
	Script  string // path to the script/application that this task should execute
	Workers int    // number of concurrent go-routines, available for this task
}

A Task stores information that task-workers need to execute their script/application.

Jump to

Keyboard shortcuts

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