projectconfig

package
v0.185.6 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPaths added in v0.157.0

func ConfigPaths(input []string) []string

ConfigPaths returns the computed list of configuration paths to load.

func GetDefaultConfigPath added in v0.176.0

func GetDefaultConfigPath() string

func Save

func Save(path string, config Config) error

Save project config atomically to a file.

Types

type Commands added in v0.163.11

type Commands struct {
	Startup []string `toml:"startup"`
}

type Config

type Config struct {
	Global        ConfigAndSecrets            `toml:"global"`
	Modules       map[string]ConfigAndSecrets `toml:"modules"`
	ModuleDirs    []string                    `toml:"module-dirs"`
	ExternalDirs  []string                    `toml:"external-dirs"`
	Executables   Executables                 `toml:"executables"`
	Commands      Commands                    `toml:"commands"`
	FTLMinVersion string                      `toml:"ftl-min-version"`
}

func LoadConfig added in v0.157.0

func LoadConfig(ctx context.Context, input []string) (Config, error)

func LoadWritableConfig added in v0.157.0

func LoadWritableConfig(ctx context.Context, input []string) (Config, error)

LoadWritableConfig loads the last config file in the list of paths, or an empty config if none are found.

func Merge added in v0.145.0

func Merge(paths ...string) (Config, error)

Merge configuration files.

Config is merged left to right, with later files taking precedence over earlier files.

type ConfigAndSecrets

type ConfigAndSecrets struct {
	Config  map[string]*URL `toml:"configuration"`
	Secrets map[string]*URL `toml:"secrets"`
}

type Executables added in v0.163.11

type Executables struct {
	FTL string `toml:"ftl"`
}

type URL

type URL url.URL

A URL that supports marshalling and unmarshalling which is, very frustratingly, not possible with the stdlib url.URL.

func MustParseURL

func MustParseURL(rawurl string) *URL

func ParseURL

func ParseURL(rawurl string) (*URL, error)

func (URL) GoString

func (u URL) GoString() string

func (URL) MarshalText

func (u URL) MarshalText() ([]byte, error)

func (*URL) UnmarshalText

func (u *URL) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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