config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	IsSelectMode bool     `yaml:"is_select_mode"`
	FileIgnores  []string `yaml:"file_ignores"`
	ShowConfig   string   `yaml:"show_config"`
	Session      bool     `yaml:"session"`
}

type Hook

type Hook struct {
	Command  string   `yaml:"command"`
	Settings Settings `yaml:"settings"`
}

type Program

type Program struct {
	Name        string   `yaml:"name" validate:"required"`
	Image       string   `yaml:"image" validate:"required"`
	Command     string   `yaml:"command"`
	Serializer  string   `yaml:"serializer" validate:"oneof='' default string testhandler"`
	Description string   `yaml:"description"`
	Tag         string   `yaml:"tag"`
	Category    string   `yaml:"category"`
	Hooks       []Hook   `yaml:"hooks" validate:"dive"`
	Settings    Settings `yaml:"settings"`
	Dockerfile  string   `yaml:"dockerfile"`
}

type ProgramConfig

type ProgramConfig struct {
	Programs []Program `yaml:"programs" validate:"required,dive"`
	Settings Settings  `yaml:"settings"`
}

func LoadConfig

func LoadConfig(withDefaults bool) (*ProgramConfig, []string, error)

type Settings

type Settings struct {
	Net         string   `yaml:"net" validate:"oneof='' none host bridge"`
	IgnorePaths []string `yaml:"ignore_paths"`
	Mounts      []string `yaml:"mounts"`
	Platform    string   `yaml:"platform" validate:"platform"`
}

func MergeSettings

func MergeSettings(base, override Settings) (Settings, error)

mergeSettings merges two Settings objects with the values from the override having priority and concatenates IgnorePaths slices without duplicates.

func (*Settings) IsEmpty

func (s *Settings) IsEmpty() bool

Jump to

Keyboard shortcuts

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