exec

package
v0.0.0-...-bfcee01 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PathExists

func PathExists(path string) (bool, error)

PathExists is used to check if a local path exists.

Types

type CacheConfig

type CacheConfig struct {
	TTL time.Duration `json:"ttl"`
}

CacheConfig is the data structure for configuring the go-cache.

type Config

type Config struct {
	Plugins PluginsConfig `json:"plugins"`
	Logging LoggingConfig `json:"logging"`
	Cache   CacheConfig   `json:"cache"`
	Git     GitConfig     `json:"git"`
	HTTP    HTTPConfig    `json:"http"`
	Tests   Tests         `json:"tests"`
}

Config is the data structure for chick base configurations.

func ReadConfig

func ReadConfig() (*Config, error)

ReadConfig reads the chicka config file into a data structure.

func (*Config) Refresh

func (cfg *Config) Refresh() error

Refresh reloads the config data structure from the chicka config file.

type Controller

type Controller struct {
	Ctx    context.Context
	Cancel context.CancelFunc
}

Controller is a struct for managing executions.

func NewController

func NewController() *Controller

NewController sets up the controller for managing tests.

func (*Controller) Reset

func (ctrl *Controller) Reset()

Reset sets a new context with cancel support into the controller.

func (*Controller) Run

func (ctrl *Controller) Run(cfg *Config, c *cache.Cache, l LoggerSvc, e ErrorSvc)

Run is used to execute all tests defined in the configuration.

type ErrorResult

type ErrorResult struct {
	TestCommand string `json:"test_command"`
	Error       error  `json:"error"`
}

ErrorResult is the struct used to store error information.

type ErrorSvc

type ErrorSvc interface {
	Send(testCommand string, err error)
	Listen()
}

ErrorSvc is the interface to use for handling errors.

func NewErrorSvc

func NewErrorSvc(w io.Writer) ErrorSvc

NewErrorSvc returns the error service interface.

type GitConfig

type GitConfig struct {
	URL string `json:"url"`
}

GitConfig is the data structure for configuring the plugins git repo.

type HTTPConfig

type HTTPConfig struct {
	API string `json:"api"`
	WWW string `json:"www"`
}

HTTPConfig is the data struct for configuring HTTP services.

type LoggerSvc

type LoggerSvc interface {
	Send(result Result)
	Listen()
}

LoggerSvc is the interface for managing logging functions.

func NewLoggerSvc

func NewLoggerSvc(loggers ...log.Logger) LoggerSvc

NewLoggerSvc returns a LoggerSvc interface.

type LoggingConfig

type LoggingConfig struct {
	Path string `json:"path"`
}

LoggingConfig is the data structure for configuring logging.

type PluginsConfig

type PluginsConfig struct {
	Path string `json:"path"`
}

PluginsConfig is the data structure for configuring plugins.

type Result

type Result struct {
	Command     string      `json:"command"`
	Expect      bool        `json:"expect"`
	Result      bool        `json:"result"`
	Data        interface{} `json:"data"`
	Description string      `json:"description"`
}

Result is a struct for storing plugin execution results.

type Results

type Results map[string]Result

Results is a slice of result.

type Test

type Test struct {
	Command  string   `json:"command"`
	Args     []string `json:"args"`
	Interval int      `json:"interval"`
	Expect   bool     `json:"expect"`
}

Test is a struct for defining test settings.

func (*Test) Validate

func (t *Test) Validate() error

Validate is used to validate the test.

type Tests

type Tests []Test

Tests is a slice of test.

Jump to

Keyboard shortcuts

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