config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BinDir            = "bin"
	TmpDir            = "tmp"
	EvtsDir           = "evts"
	EvtDescriptorFile = "event.json"
)

Variables

This section is empty.

Functions

func Defaults

func Defaults()

Defaults configure defaults for the configuration

Types

type DockerMachine

type DockerMachine struct {
	Version   string                         `mapstructure:"version"`
	BinaryURL string                         `mapstructure:"binary_url"`
	Binary    string                         `mapstructure:"binary"`
	Drivers   map[string]DockerMachineDriver `mapstructure:"drivers"`
	Env       []string                       `mapstructure:"env"`
}

DockerMachine describes the host's docker-machine binary

type DockerMachineDriver

type DockerMachineDriver struct {
	Version   string   `mapstructure:"version"`
	BinaryURL string   `mapstructure:"binary_url"`
	Binary    string   `mapstructure:"binary"`
	Params    []string `mapstructure:"params"`
	Env       []string `mapstructure:"env"`
}

DockerMachineDriver describes the location and environment params of any optional (non-built-in) docker-machine drivers on the host system

type Schema

type Schema struct {
	Workspace     string        `mapstructure:"workspace"`
	DockerMachine DockerMachine `mapstructure:"docker_machine"`
	Web           WebSchema     `mapstructure:"web"`
	// the following are used at runtime
	RuntimeStartedAt time.Time `mapstructure:"-"`
	RuntimeVersion   string    `mapstructure:"-"`
}

Schema describes the layout of config.yaml

func (*Schema) Bin added in v1.0.1

func (s *Schema) Bin(file string) string

Bin returns /tmp/workspace/bin/<FILE>

func (*Schema) ConfigDir added in v1.0.1

func (s *Schema) ConfigDir(eventID string) (finalPath string, err error)

ConfigDir returns /tmp/workspace/evts/drop-28b10d4eff415a7b0b2c/nodeconfigs

func (*Schema) DmBin added in v1.0.1

func (s *Schema) DmBin() string

DmBin returns /tmp/workspace/bin/docker-machine

func (*Schema) EvtFile added in v1.0.1

func (s *Schema) EvtFile(evtID string) (path string, err error)

EvtFile returns "/tmp/workspace/evts/<EVTID>/event.json", i.e. the absolute path to the event descriptor file

func (*Schema) Evts added in v1.0.1

func (s *Schema) Evts(evtID string) (string, error)

Evts returns /tmp/workspace/evts/<EVTID>

func (*Schema) ExtraAccountConfigDir added in v1.0.1

func (s *Schema) ExtraAccountConfigDir(eventID, name string) (finalPath string, err error)

ExtraAccountConfigDir returns /tmp/workspace/evts/drop-28b10d4eff415a7b0b2c/nodeconfig/extra_accounts

func (*Schema) NodeConfigDir added in v1.0.1

func (s *Schema) NodeConfigDir(eventID, nodeID string) (configDir string, err error)

NodeConfigDir returns /tmp/workspace/evts/drop-28b10d4eff415a7b0b2c/nodeconfig/0

func (*Schema) Tmp added in v1.0.1

func (s *Schema) Tmp() (string, error)

Tmp returns /Tmp/workspace/tmp

type WebSchema

type WebSchema struct {
	ListenAddress   string `mapstructure:"listen_address"`
	DefaultProvider string `mapstructure:"default_provider"`
	UsersDbFile     string `mapstructure:"users_db_file"`
}

WebSchema configuration for web

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳