config

package
v0.0.0-...-8e6cb86 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheOrderLatency = "latency"
	CacheOrderNone    = "none"
)

Variables

This section is empty.

Functions

func ParseAndApply

func ParseAndApply(name string, cfg *Config) error

func ProfilesFromEnv

func ProfilesFromEnv() []string

Types

type BaseConfig

type BaseConfig struct {
	Version  Version
	Location string
}

type Cache

type Cache struct {
	URI       string
	Read      bool
	Write     bool
	Secondary bool
}

type Config

type Config struct {
	BaseConfig   `yaml:",inline"`
	Caches       map[string]Cache
	CacheOrder   string `yaml:"cache_order"`
	CacheHistory int    `yaml:"cache_history"`
	Cloud        struct {
		URL     string `yaml:"url"`
		Project string `yaml:"project"`
	} `yaml:"cloud"`
	Engine struct {
		GC              bool `yaml:"gc"`
		CacheHints      bool `yaml:"cache_hints"`
		InstallTools    bool `yaml:"install_tools"`
		KeepSandbox     bool `yaml:"keep_sandbox"`
		ParallelCaching bool `yaml:"parallel_caching"`
		SmartGen        bool `yaml:"smart_gen"`
	} `yaml:"engine"`
	Platforms  map[string]Platform `yaml:"platforms"`
	BuildFiles struct {
		Patterns []string        `yaml:"patterns"`
		Ignore   []string        `yaml:"ignore"`
		Roots    map[string]Root `yaml:"roots"`
		Glob     struct {
			Exclude []string `yaml:"exclude"`
		} `yaml:"glob"`
	} `yaml:"build_files"`
	Watch struct {
		Ignore []string `yaml:"ignore"`
	} `yaml:"watch"`
	Fmt struct {
		IndentSize int `yaml:"indent_size,omitempty"`
	} `yaml:"fmt"`
	Params map[string]string `yaml:"params"`

	Extras `yaml:",inline"`

	Sources  []FileConfig `yaml:"-"`
	Profiles []string     `yaml:"-"`
}

func (Config) OrderedPlatforms

func (c Config) OrderedPlatforms() []Platform

type Extras

type Extras map[string]interface{}

type FileCache

type FileCache struct {
	URI       string `yaml:"uri"`
	Read      *bool  `yaml:",omitempty"`
	Write     *bool  `yaml:",omitempty"`
	Secondary *bool  `yaml:",omitempty"`
}

func (FileCache) ApplyTo

func (fc FileCache) ApplyTo(c Cache) Cache

type FileConfig

type FileConfig struct {
	BaseConfig   `yaml:",inline"`
	Caches       map[string]FileCache `yaml:"caches,omitempty"`
	CacheOrder   string               `yaml:"cache_order"`
	CacheHistory int                  `yaml:"cache_history"`
	Cloud        struct {
		URL     string `yaml:"url"`
		Project string `yaml:"project"`
	} `yaml:"cloud"`
	Engine struct {
		GC              *bool `yaml:"gc"`
		CacheHints      *bool `yaml:"cache_hints"`
		InstallTools    *bool `yaml:"install_tools"`
		KeepSandbox     *bool `yaml:"keep_sandbox"`
		ParallelCaching *bool `yaml:"parallel_caching"`
		SmartGen        *bool `yaml:"smart_gen"`
	} `yaml:"engine"`
	Platforms  map[string]FilePlatform `yaml:"platforms"`
	BuildFiles struct {
		Patterns []string            `yaml:"patterns,omitempty"`
		Ignore   []string            `yaml:"ignore,omitempty"`
		Roots    map[string]FileRoot `yaml:"roots,omitempty"`
		Glob     struct {
			Exclude []string `yaml:"exclude"`
		} `yaml:"glob"`
	} `yaml:"build_files"`
	Watch struct {
		Ignore []string `yaml:"ignore,omitempty"`
	} `yaml:"watch"`
	Fmt struct {
		IndentSize int `yaml:"indent_size,omitempty"`
	} `yaml:"fmt"`
	Params map[string]string `yaml:"params"`
	Extras `yaml:",inline"`
}

func Parse

func Parse(name string) (FileConfig, error)

func (FileConfig) ApplyTo

func (fc FileConfig) ApplyTo(c Config) Config

type FilePlatform

type FilePlatform struct {
	Provider string                 `yaml:"provider"`
	Priority *int                   `yaml:"priority"`
	Options  map[string]interface{} `yaml:"options,omitempty"`
}

func (FilePlatform) ApplyTo

func (fc FilePlatform) ApplyTo(c Platform) Platform

type FileRoot

type FileRoot struct {
	URI string `yaml:"uri"`
}

func (FileRoot) ApplyTo

func (fc FileRoot) ApplyTo(c Root) Root

type Platform

type Platform struct {
	Name     string                 `yaml:"name"`
	Provider string                 `yaml:"provider"`
	Priority int                    `yaml:"priority"`
	Options  map[string]interface{} `yaml:"options"`
}

type Root

type Root struct {
	URI string
}

type Version

type Version struct {
	String string
	Semver *semver.Version
	GTE    bool
}

func (Version) MarshalYAML

func (e Version) MarshalYAML() (interface{}, error)

func (*Version) UnmarshalYAML

func (e *Version) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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