config

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnmarshal is returned when config can't be unmarshaled.
	ErrUnmarshal = errors.New("max: can't unmarshal config value")
	// ErrCreateCache is returned when cache can't be created.
	ErrCreateCache = errors.New("max: can't create cache")
)

Functions

func CreateCache added in v1.1.0

func CreateCache() (*cache.Cache, error)

CreateCache creates a new cache.

Types

type Config

type Config struct {
	Args      map[string]interface{}
	Tasks     map[string]*task.Task
	Variables map[string]string
	Version   string
	// contains filtered or unexported fields
}

Config represents a config file.

func ReadContent

func ReadContent(content string) (*Config, error)

ReadContent creates a new config struct from a string.

func ReadFile

func ReadFile(args ...string) (*Config, error)

ReadFile creates a new config struct from a yaml file.

func (*Config) Default added in v1.1.0

func (c *Config) Default()

Default set default values to config struct.

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml packages interface to unmarshal custom values.

Jump to

Keyboard shortcuts

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