config

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	IgnoreDirs []string `yaml:"ignoreDirs"`
}

type Command

type Command struct {
	Name    string
	Command string
}

Command is a configuration structure which consists of a name (e.g., print_hello) and a command (e.g., "echo hello")

type Deploy

type Deploy struct {
	Folder         string
	TemplaterImage string `yaml:"templaterImage"`
}

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

Jump to

Keyboard shortcuts

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