config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDirExists added in v0.0.3

func EnsureDirExists(dir string) error

EnsureDirExists creates the named directory if it does not exist.

Types

type Config

type Config struct {
	// StateLocation is either a file containing a pre-compiled state, or
	// a directory containing the state as a tree.
	StateLocation string `env:"SOUS_STATE_LOCATION"`
	// Server is the location of a Sous Server which this sous instance
	// considers the master. If this is not set, this node is considered
	// to be a master. This value must be in URL format.
	Server string `env:"SOUS_SERVER"`
	// SiblingURLs is a temporary measure for setting up a distributed cluster
	// of sous servers. Each server must be configured with accessible URLs for
	// all the servers in production, as named by cluster.
	// (someday this should be replaced with a gossip protocol)
	SiblingURLs map[string]string
	// BuildStateDir is a directory where information about builds
	// performed by this user on this machine are stored.
	BuildStateDir string `env:"SOUS_BUILD_STATE_DIR"`
	// Docker is the Docker configuration.
	Docker docker.Config
}

Config contains the core Sous configuration, shared by both the client and server. The client and server may additionally have their own configuration.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration.

func (*Config) Equal added in v0.0.3

func (c *Config) Equal(other *Config) bool

Equal compares

func (*Config) FillDefaults

func (c *Config) FillDefaults() error

FillDefaults fills in default values in this Config where they are currently zero values.

func (Config) Validate added in v0.0.3

func (c Config) Validate() error

Validate returns an error if this config is invalid.

type DeployFilterFlags

type DeployFilterFlags struct {
	Source   string
	Repo     string
	Offset   string
	Flavor   string
	Tag      string
	Revision string
	Cluster  string
	All      bool
}

DeployFilterFlags are CLI flags used to configure the underlying deployments a given command will refer to N.b. that not every command will use every filter

func (*DeployFilterFlags) BuildFilter added in v0.0.3

func (f *DeployFilterFlags) BuildFilter(parseSL func(string) (sous.SourceLocation, error)) (*sous.ResolveFilter, error)

func (*DeployFilterFlags) BuildPredicate

func (f *DeployFilterFlags) BuildPredicate(parseSL func(string) (sous.SourceLocation, error)) (sous.DeploymentPredicate, error)

BuildPredicate returns a predicate used for filtering targeted deployments.

It returns an error if the combination of flags is invalid, or if parseSL returns an error parsing Source.

type OTPLFlags

type OTPLFlags struct {
	UseOTPLDeploy    bool `flag:"use-otpl-deploy"`
	IgnoreOTPLDeploy bool `flag:"ignore-otpl-deploy"`
}

OTPLFlags set options for sniffing otpl-deploy configuration during manifest initialisation.

type PolicyFlags

type PolicyFlags struct {
	ForceClone, Strict bool
}

PolicyFlags capture user intent about the processing of a build

type User

type User struct {
	*user.User
}

User represents the user environment of the account running Sous

func (*User) ConfigDir

func (u *User) ConfigDir() string

ConfigDir returns the directory we should use to store Sous configuration data

func (*User) ConfigFile

func (u *User) ConfigFile() string

ConfigFile returns the path to the local Sous config file

func (*User) DefaultConfig

func (u *User) DefaultConfig() Config

DefaultConfig builds a default configuration for this user

type Verbosity

type Verbosity struct {
	Silent, Quiet, Loud, Debug bool
}

Verbosity configures how chatty Sous is on its logs

Jump to

Keyboard shortcuts

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