config

package
v0.0.0-...-ddc7402 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoShedFile = errors.New("No .shed.yml or shed.yml file found")
)

Functions

func Def

func Def(a, b string) string

Def returns second parameter if first parameter length is zero.

func DefList

func DefList(a, b []string) []string

DefList returns second parameter if first parameter length is zero.

Types

type Config

type Config struct {
	AfterScript  List              `yaml:"after_script"`
	BeforeScript List              `yaml:"before_script"`
	Branches     map[string]Config `yaml:"branches"`
	Docker       Docker            `yaml:"docker"`
	Git          Git               `yaml:"git"`
	Host         string            `yaml:"host"`
	HTTPS        bool              `yaml:"https"`
	Script       List              `yaml:"script"`
}

Config represents a config file.

func NewConfig

func NewConfig(args ...string) (Config, error)

NewConfig creates a new config struct from a yaml file.

type Docker

type Docker struct {
	Machine string      `yaml:"machine"`
	Proxy   DockerProxy `yaml:"proxy"`
	Volumes List        `yaml:"volumes"`
}

Docker represents a docker config section.

type DockerProxy

type DockerProxy struct {
	Image     string `yaml:"image"`
	Env       List   `yaml:"env"`
	HTTPPort  string `yaml:"http_port"`
	HTTPSPort string `yaml:"https_port"`
	Recreate  bool   `yaml:"recreate"`
	Volumes   List   `yaml:"volumes"`
}

DockerProxy represents a docker proxy config section.

type Git

type Git struct {
	Branch string `yaml:"branch"`
	Path   string `yaml:"path"`
}

Git represents a git config section.

type List

type List struct {
	Values []string
}

List represents single or multi strings.

func (*List) UnmarshalYAML

func (l *List) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshal single or multi strings.

Jump to

Keyboard shortcuts

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