config

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingBundleName    = errors.New("missing bundle name")
	ErrMissingTargetName    = errors.New("missing target name")
	ErrMissingTargetCommand = errors.New("missing target command")
	ErrInvalidTargetRef     = errors.New("invalid target ref")
	ErrInvalidDependency    = errors.New("invalid dependency")
	ErrMissingProjectName   = errors.New("missing project name")
)

Functions

func ValidateDependencyImage added in v0.4.0

func ValidateDependencyImage(image string) error

Types

type BundleConfig

type BundleConfig struct {
	Name    string          `koanf:"name"`
	Env     BundleEnvConfig `koanf:"env"`
	Targets []TargetConfig  `koanf:"targets"`
}

func (*BundleConfig) SetDefaults

func (b *BundleConfig) SetDefaults()

type BundleEnvConfig added in v0.4.0

type BundleEnvConfig struct {
	Variables map[string]string `koanf:"variables"`
	Deps      []string          `koanf:"deps"`
}

type Config

type Config struct {
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

func NewConfigWithRepoFile added in v0.4.0

func NewConfigWithRepoFile(path string) *Config

func (*Config) AllTargets

func (c *Config) AllTargets() []*models.Target

func (*Config) BuildsPath

func (c *Config) BuildsPath() string

func (*Config) Bundles

func (c *Config) Bundles() map[string]*models.Bundle

func (*Config) CacheDir added in v0.4.0

func (c *Config) CacheDir() string

func (*Config) DagPath

func (c *Config) DagPath() string

func (*Config) EnvironmentDependencies added in v0.4.0

func (c *Config) EnvironmentDependencies() map[string]models.EnvironmentDependency

func (*Config) QueryTargets added in v0.4.0

func (c *Config) QueryTargets(query func(*models.Target) bool) []*models.Target

func (*Config) Repo

func (c *Config) Repo() *RepoConfig

func (*Config) RepoRoot

func (c *Config) RepoRoot() string

func (*Config) ResolveTarget

func (c *Config) ResolveTarget(ref string) (*models.Target, error)

type DotenvConfig

type DotenvConfig struct {
	Enabled *bool    `koanf:"enabled"`
	Files   []string `koanf:"files"`
}

type EnvironmentDependency added in v0.4.0

type EnvironmentDependency struct {
	Name         string            `koanf:"name"`
	Image        string            `koanf:"image"`
	Env          map[string]string `koanf:"env"`
	Ports        []string          `koanf:"ports"`
	Volumes      []string          `koanf:"volumes"`
	ReadinessCmd string            `koanf:"readiness-cmd"`
}

func (*EnvironmentDependency) SetDefaults added in v0.4.0

func (d *EnvironmentDependency) SetDefaults()

type InitStep added in v0.4.0

type InitStep struct {
	Label      string `koanf:"label"`
	CheckCmd   string `koanf:"check_cmd"`
	InstallCmd string `koanf:"install_cmd"`
}

type LoggerConfig added in v0.3.0

type LoggerConfig struct {
	DateTime LoggerDateTimeConfig `koanf:"datetime"`
}

type LoggerDateTimeConfig added in v0.3.0

type LoggerDateTimeConfig struct {
	Format string `koanf:"format"`
}

type ProjectConfig added in v0.4.0

type ProjectConfig struct {
	Name string `koanf:"name"`
}

type RepoConfig

type RepoConfig struct {
	Project ProjectConfig `koanf:"project"`
	Shell   string        `koanf:"shell"`
	Env     RepoEnvConfig `koanf:"env"`
	Init    []InitStep    `koanf:"init"`
	Ignore  []string      `koanf:"ignore"`
	Logger  LoggerConfig  `koanf:"logger"`
}

func (*RepoConfig) SetDefaults

func (r *RepoConfig) SetDefaults()

type RepoEnvConfig added in v0.4.0

type RepoEnvConfig struct {
	Vars map[string]string       `koanf:"vars"`
	Deps []EnvironmentDependency `koanf:"deps"`
}

type TargetConfig

type TargetConfig struct {
	Name   string            `koanf:"name"`
	In     []string          `koanf:"in"`
	Out    []string          `koanf:"out"`
	Deps   []string          `koanf:"deps"`
	Env    map[string]string `koanf:"env"`
	Cmd    interface{}       `koanf:"cmd"`
	Config TargetOptions     `koanf:"config"`
}

func (*TargetConfig) GetCmd

func (t *TargetConfig) GetCmd() string

func (*TargetConfig) SetDefaults

func (t *TargetConfig) SetDefaults()

type TargetOptions

type TargetOptions struct {
	WorkingDir string       `koanf:"working_dir"`
	Dotenv     DotenvConfig `koanf:"dotenv"`
	Reload     *bool        `koanf:"reload"`
	Ignore     []string     `koanf:"ignore"`
	Index      *int         `koanf:"index"`
}

Jump to

Keyboard shortcuts

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