config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Overview

Package config provides the frizbee configuration.

Index

Constants

This section is empty.

Variables

View Source
var ContextConfigKey = contextConfigKey{}

ContextConfigKey is the context key for the configuration. nolint:gochecknoglobals // this is a context key

View Source
var (
	// ErrNoConfigInContext is returned when no configuration is found in the context.
	ErrNoConfigInContext = errors.New("no configuration found in context")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Platform  string    `yaml:"platform" mapstructure:"platform"`
	GHActions GHActions `yaml:"ghactions" mapstructure:"ghactions"`
	Images    Images    `yaml:"images" mapstructure:"images"`
}

Config is the frizbee configuration.

func DefaultConfig added in v0.0.20

func DefaultConfig() *Config

DefaultConfig returns the default configuration.

func FromCommand

func FromCommand(cmd *cobra.Command) (*Config, error)

FromCommand returns the configuration from the cobra command.

func MergeUserConfig added in v0.0.20

func MergeUserConfig(userConfig *Config) *Config

MergeUserConfig merges the user configuration with the default configuration. mostly making sure that we don't try to pin the scratch image

func ParseConfigFile

func ParseConfigFile(configfile string) (*Config, error)

ParseConfigFile parses a configuration file.

func ParseConfigFileFromFS

func ParseConfigFileFromFS(fs billy.Filesystem, configfile string) (*Config, error)

ParseConfigFileFromFS parses a configuration file from a filesystem.

type Filter

type Filter struct {
	// Exclude is a list of patterns to exclude.
	Exclude         []string `yaml:"exclude" mapstructure:"exclude"`
	ExcludeBranches []string `yaml:"exclude_branches" mapstructure:"exclude_branches"`
}

Filter is a common configuration for filtering out patterns.

type GHActions

type GHActions struct {
	Filter `yaml:",inline" mapstructure:",inline"`
}

GHActions is the GitHub Actions configuration.

type ImageFilter added in v0.0.20

type ImageFilter struct {
	// ExcludeImages is a regex that must match in order for an image to be excluded and not pinned
	ExcludeImages []string `yaml:"exclude_images" mapstructure:"exclude_images"`
	ExcludeTags   []string `yaml:"exclude_tags" mapstructure:"exclude_tags"`
}

ImageFilter is the image filter configuration.

type Images added in v0.0.20

type Images struct {
	ImageFilter `yaml:",inline" mapstructure:",inline"`
}

Images is the image configuration.

Jump to

Keyboard shortcuts

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