Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
Command is a configuration structure which consists of a name (e.g., print_hello) and a command (e.g., "echo hello")
type Deploy ¶
Deploy handles configuration options for templating & saving the built kubernetes .yamls
type Environment ¶
type Environment struct {
Commands []Command
//Provisioner can be one of:
// - k3s, which uses "k3s.kubectl" commands, or
// - external, an environment which has been set up with kubeadm on a server
ClusterProvisioner string `yaml:"clusterProvisioner"`
ClusterProvisionerArgs map[string]string `yaml:"clusterProvisionerArgs"`
Namespace string
}
Environment is a specific environment which can be entered with "sanic env"
type SanicConfig ¶
type SanicConfig struct {
Commands []Command
Environments map[string]Environment
Deploy Deploy
Build Build
}
SanicConfig is the global structure of entries in sanic.yaml
func Read ¶
func Read() (SanicConfig, error)
Read returns a new SanicConfig, given that the environment (e.g., sanic env) has one configured
func ReadFromPath ¶
func ReadFromPath(configPath string) (SanicConfig, error)
ReadFromPath returns a new SanicConfig from the given filesystem path to a yaml file
func (*SanicConfig) CurrentEnvironment ¶
func (cfg *SanicConfig) CurrentEnvironment(s shell.Shell) (*Environment, error)
CurrentEnvironment returns an Environment struct corresponding to the environment the user is in. Fails if the user is not in an environment
func (*SanicConfig) HasEnvironment ¶
func (cfg *SanicConfig) HasEnvironment(env string) bool
HasEnvironment returns the configuration has a given environment defined