Documentation ¶
Overview ¶
Package config is the configuration structure and related functions.
Index ¶
- Constants
- func EvalContext(pwd string) *hcl.EvalContext
- func FindPath(start, filename string) (string, error)
- func TestConfigFile(t testing.T, src string)
- func TestSource(t testing.T) string
- func ValidateLabels(labels map[string]string) []error
- type App
- type AppURL
- type Build
- type CEBConfig
- type Config
- type DataSource
- type Deploy
- type Hook
- type Listener
- type Operation
- type Plugin
- type Registry
- type Release
- type Runner
- type Server
- type ServerConfig
- type URL
- type Use
Constants ¶
const Filename = "waypoint.hcl"
Filename is the default filename for the Waypoint configuration.
Variables ¶
This section is empty.
Functions ¶
func EvalContext ¶
func EvalContext(pwd string) *hcl.EvalContext
EvalContext returns the common eval context to use for parsing all configurations. This should always be available for all config types.
The pwd param is the directory to use as a working directory for determining things like relative paths. This should be considered the pwd over the actual process pwd.
func FindPath ¶
FindPath looks for our configuration file starting at "start" and traversing parent directories until it is found. If it is found, the path is returned. If it is not found, an empty string is returned. Error will be non-nil only if an error occurred.
If start is empty, start will be the current working directory. If filename is empty, it will default to the Filename constant.
func TestConfigFile ¶
func TestConfigFile(t testing.T, src string)
TestConfigFile writes the default Waypoint configuration file with the given contents.
func ValidateLabels ¶
ValidateLabels validates a set of labels.
Types ¶
type App ¶
type App struct { Name string `hcl:",label"` Path string `hcl:"path,optional"` Labels map[string]string `hcl:"labels,optional"` URL *AppURL `hcl:"url,block" default:"{}"` Build *Build `hcl:"build,block"` Deploy *Deploy `hcl:"deploy,block"` Release *Release `hcl:"release,block"` }
App represents a single application.
type AppURL ¶
type AppURL struct {
AutoHostname *bool `hcl:"auto_hostname,optional"`
}
AppURL configures the App-specific URL settings.
type Build ¶
type Build struct { Labels map[string]string `hcl:"labels,optional"` Hooks []*Hook `hcl:"hook,block"` Use *Use `hcl:"use,block"` Registry *Registry `hcl:"registry,block"` }
Build are the build settings.
func (*Build) RegistryOperation ¶
type CEBConfig ¶
type CEBConfig struct { Addr string `hcl:"addr,optional"` TLSEnabled bool `hcl:"tls_enabled,optional"` TLSSkipVerify bool `hcl:"tls_skip_verify,optional"` }
CEBConfig is specific configuration for the entrypoint binaries injected into the deployments
type Config ¶
type Config struct { Runner *Runner `hcl:"runner,block" default:"{}"` Project string `hcl:"project,attr"` Apps []*App `hcl:"app,block"` Labels map[string]string `hcl:"labels,optional"` Plugin []*Plugin `hcl:"plugin,block"` }
Config is the configuration structure.
func TestConfig ¶
TestConfig returns a Config from a string source and fails the test if parsing the configuration fails.
func (*Config) Default ¶
Default sets the default values where values are unset on this config. This will modify the config in place.
type DataSource ¶
type DataSource struct { Type string `hcl:",label"` Body hcl.Body `hcl:",remain"` }
DataSource configures the data source for the runner.
type Deploy ¶
type Deploy struct { Labels map[string]string `hcl:"labels,optional"` Hooks []*Hook `hcl:"hook,block"` Use *Use `hcl:"use,block"` }
Deploy are the deploy settings.
type Hook ¶
type Hook struct { When string `hcl:"when,attr"` Command []string `hcl:"command,attr"` OnFailure string `hcl:"on_failure,optional"` }
Hook is the configuration for a hook that runs at specified times.
func (*Hook) ContinueOnFailure ¶
type Operation ¶
type Operation struct { Labels map[string]string `hcl:"labels,optional"` Hooks []*Hook `hcl:"hook,block"` Use *Use `hcl:"use,block"` // contains filtered or unexported fields }
Operation is something in the Waypoint configuraiton that is executed using some underlying plugin. This is a general shared structure that is used by internal/core to initialize all the proper plugins.
type Plugin ¶
type Plugin struct { // Name of the plugin. This is expected to match the plugin binary // "waypoint-plugin-<name>" including casing. Name string `hcl:",label"` // Type is the type of plugin this is. This can be multiple. Type struct { Mapper bool `hcl:"mapper,optional"` Builder bool `hcl:"build,optional"` Registry bool `hcl:"registry,optional"` Platform bool `hcl:"deploy,optional"` Releaser bool `hcl:"release,optional"` } `hcl:"type,block"` // Checksum is the SHA256 checksum to validate this plugin. Checksum string `hcl:"checksum,optional"` }
Plugin configures a plugin.
type Registry ¶
type Registry struct { Labels map[string]string `hcl:"labels,optional"` Hooks []*Hook `hcl:"hook,block"` Use *Use `hcl:"use,block"` }
Registry are the registry settings.
type Release ¶
type Release struct { Labels map[string]string `hcl:"labels,optional"` Hooks []*Hook `hcl:"hook,block"` Use *Use `hcl:"use,block"` }
Release are the release settings.
type Runner ¶
type Runner struct { // Enabled is whether or not runners are enabled. If this is false // then the "-remote" flag will not work. Enabled bool `hcl:"enabled,optional"` // DataSource is the default data source when a remote job is queued. DataSource *DataSource `hcl:"data_source,block"` }
Runner is the configuration for supporting runners in this project.
type Server ¶
type Server struct { Address string `hcl:"address,attr"` // Tls, if true, will connect to the server with TLS. If TlsSkipVerify // is true, the certificate presented by the server will not be validated. Tls bool `hcl:"tls,optional"` TlsSkipVerify bool `hcl:"tls_skip_verify,optional"` // AddressInternal is a temporary config to work with local deployments // on platforms such as Docker for Mac. We need to discuss a more // long term approach to this. AddressInternal string `hcl:"address_internal,optional"` // Indicates that we need to present a token to connect to this server. RequireAuth bool `hcl:"require_auth,optional"` // AuthToken is the token to use to authenticate to the server. // Note this will be stored plaintext on disk. You can also use the // WAYPOINT_SERVER_TOKEN env var. AuthToken string `hcl:"auth_token,optional"` }
Server configures the remote server.
type ServerConfig ¶
type ServerConfig struct { // DBPath is the path to the database file, including the filename. DBPath string `hcl:"db_path,attr"` // GRPC is the grpc service listening configuration. This is required. GRPC Listener `hcl:"grpc,block"` // HTTP is the listening configuration for the HTTP service for grpc-web. HTTP Listener `hcl:"http,block"` // URL configures a server to use a URL service. URL *URL `hcl:"url,block"` // CEBConfig configures the entrypoint binary for deployments CEBConfig *CEBConfig `hcl:"entrypoint_config,block"` }
ServerConfig is the configuration for the built-in server.
type URL ¶
type URL struct { Enabled bool `hcl:"enabled,optional"` APIAddress string `hcl:"api_address,optional"` APIInsecure bool `hcl:"api_insecure,optional"` APIToken string `hcl:"api_token,optional"` ControlAddress string `hcl:"control_address,optional"` AutomaticAppHostname bool `hcl:"automatic_app_hostname,optional"` }
URL is the configuration for the URL service.