config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Current = CIDConfig{}

Functions

func LoadConfigurationFile

func LoadConfigurationFile(config interface{}, file string) (err error)

Types

type BinaryExecutionCandidate

type BinaryExecutionCandidate struct {
	Binary  string
	Version string
	Type    ExecutionType

	// File holds the absolute path to the executable file
	File string

	// Image holds the container image
	Image string

	// ImageCache holds information about caching for containers
	ImageCache []catalog.ImageCache

	// Mounts
	Mounts []catalog.ContainerMount

	// Security
	Security catalog.Security

	// Entrypoint overwrites the container entrypoint
	Entrypoint *string

	// Certs holds information to mount ca certificates into the containers
	Certs []catalog.ImageCerts `yaml:"certs,omitempty"`
}

type BranchingConventionType

type BranchingConventionType string
const (
	BranchingGitFlow BranchingConventionType = "GitFlow"
)

type CIDConfig

type CIDConfig struct {
	Paths       PathConfig
	Mode        ExecutionType `default:"PREFER_LOCAL"`
	Conventions ProjectConventions
	Env         map[string]string

	// Dependencies holds a key value map of required versions
	Dependencies map[string]string `yaml:"dependencies,omitempty"`

	// LocalTools holds a list to lookup locally installed tools for command execution
	LocalTools []ToolLocal `yaml:"localtools,omitempty"`

	// CatalogSources
	CatalogSources map[string]*catalog.Source `yaml:"catalog_sources,omitempty"`

	// Registry holding all known images, actions, workflows, ...
	Registry catalog.Config `yaml:"registry,omitempty"`
}

CIDConfig is the full struct of the configuration file

func LoadConfig

func LoadConfig(projectDirectory string) *CIDConfig

func (*CIDConfig) FindExecutionCandidates

func (c *CIDConfig) FindExecutionCandidates(binary string, constraint string, preferExecutionType ExecutionType, preferVersion PreferVersion) []BinaryExecutionCandidate

FindExecutionCandidates returns a full list of all available execution options for the specified binary

func (*CIDConfig) FindImageOfBinary

func (c *CIDConfig) FindImageOfBinary(binary string, constraint string) *catalog.ContainerImage

FindImageOfBinary retrieves information about the container image for the specified binary fulfilling the constraint

func (*CIDConfig) FindPathOfBinary

func (c *CIDConfig) FindPathOfBinary(binary string, constraint string) *ToolLocal

FindPathOfBinary retrieves information about the local path of the specified binary fulfilling the constraint

type CommitConventionType

type CommitConventionType string
const (
	ConventionalCommits CommitConventionType = "ConventionalCommits"
)

type ExecutionType

type ExecutionType string
const (
	ExecutionExec      ExecutionType = "exec"
	ExecutionContainer ExecutionType = "container"
)

type PathConfig

type PathConfig struct {
	Artifact string `default:".dist"`
	Temp     string `default:".tmp"`
	Cache    string `default:""`
}

PathConfig contains the path configuration for build/tmp directories

func (PathConfig) ArtifactModule

func (c PathConfig) ArtifactModule(dir ...string) string

ArtifactModule returns dist folder for a specific module

func (PathConfig) ModuleCache

func (c PathConfig) ModuleCache(module string) string

ModuleCache returns the cache directory for a specific module

func (PathConfig) NamedCache

func (c PathConfig) NamedCache(name string) string

NamedCache returns the cache directory for a named cache

func (PathConfig) TempModule

func (c PathConfig) TempModule(name string) string

TempModule returns temp folder for a specific module

type PreferVersion

type PreferVersion string
const (
	PreferHighest PreferVersion = "highest"
	PreferLowest  PreferVersion = "lowest"
)

type ProjectConventions

type ProjectConventions struct {
	Branching BranchingConventionType `default:"GitFlow"`
	Commit    CommitConventionType    `default:"ConventionalCommits"`
}

type ToolBinary

type ToolBinary struct {
	Binary  string `yaml:"binary"`
	Version string `yaml:"version"`
}

type ToolLocal

type ToolLocal struct {
	Binary         []string
	Lookup         []ToolLocalLookup
	LookupSuffixes []string `yaml:"lookup-suffixes"`
	Path           string
	ResolvedBinary string
}

type ToolLocalLookup

type ToolLocalLookup struct {
	Key     string // env name
	Version string // version
}

ToolLocalLookup is used to discover local tool installations based on ENV vars

Jump to

Keyboard shortcuts

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