config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConfigNotFound = errors.New("config not found")

Functions

This section is empty.

Types

type Config

type Config struct {
	Version        string                     `yaml:"version"`
	Services       map[string]ServiceConfig   `yaml:"services"`
	Defaults       EnvironmentSettings        `yaml:"defaults"`
	Environments   map[string]EnvironmentType `yaml:"environments"`
	LabelOverrides map[string]LabelOverride   `yaml:"label_overrides"`
	Notifications  NotificationConfig         `yaml:"notifications"`
}

func Load

func Load(path string) (*Config, error)

Load reads the YAML file from the given path, unmarshals it, and validates the version.

func Parse

func Parse(data []byte) (*Config, error)

func (*Config) Resolve

func (c *Config) Resolve(envType string, labels []string) *ResolvedSettings

Resolve merges defaults with the named environment type, then applies label overrides in order.

type DatabaseSettings

type DatabaseSettings struct {
	Mode             string `yaml:"mode"` // shared | schema | snapshot | fresh
	ConnectionRef    string `yaml:"connection_ref"`
	SeedSource       string `yaml:"seed_source"`
	MigrationCommand string `yaml:"migration_command"`
}

type DeploySettings

type DeploySettings struct {
	Mode      string `yaml:"mode"`      // delta | full
	Namespace string `yaml:"namespace"` // same | create
}

type EnvironmentSettings

type EnvironmentSettings struct {
	Deploy    DeploySettings    `yaml:"deploy"`
	Routing   RoutingSettings   `yaml:"routing"`
	Database  DatabaseSettings  `yaml:"database"`
	Lifecycle LifecycleSettings `yaml:"lifecycle"`
}

type EnvironmentType

type EnvironmentType struct {
	EnvironmentSettings `yaml:",inline"`
	Trigger             string `yaml:"trigger"` // label | auto | manual | branch | schedule
	Label               string `yaml:"label"`
	Branch              string `yaml:"branch"`
}

type HelmConfig

type HelmConfig struct {
	Path       string `yaml:"path"`
	ValuesFile string `yaml:"values_file"`
}

type ImageConfig

type ImageConfig struct {
	Repository  string `yaml:"repository"`
	TagTemplate string `yaml:"tag_template"`
}

type LabelOverride

type LabelOverride struct {
	EnvironmentSettings `yaml:",inline"`
	Skip                bool `yaml:"skip"`
}

type LifecycleSettings

type LifecycleSettings struct {
	TTL            string `yaml:"ttl"`
	CleanupOnMerge *bool  `yaml:"cleanup_on_merge,omitempty"`
}

type NotificationConfig

type NotificationConfig struct {
	Provider         string `yaml:"provider"` // gitlab | github
	CommentOnCreate  bool   `yaml:"comment_on_create"`
	CommentOnReady   bool   `yaml:"comment_on_ready"`
	CommentOnDestroy bool   `yaml:"comment_on_destroy"`
}

type ResolvedSettings

type ResolvedSettings struct {
	EnvironmentSettings
}

ResolvedSettings represents a fully resolved environment configuration

type RoutingSettings

type RoutingSettings struct {
	Mode              string `yaml:"mode"` // header | namespace | subdomain
	BaselineNamespace string `yaml:"baseline_namespace"`
	HeaderKey         string `yaml:"header_key"`
	Domain            string `yaml:"domain"`
}

type ServiceConfig

type ServiceConfig struct {
	Paths       []string                  `yaml:"paths"`
	Image       ImageConfig               `yaml:"image"`
	Helm        *HelmConfig               `yaml:"helm,omitempty"`
	AsyncRoutes []v1alpha1.AsyncRouteSpec `yaml:"asyncRoutes,omitempty" json:"asyncRoutes,omitempty"`
}

Jump to

Keyboard shortcuts

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