Documentation
¶
Index ¶
Constants ¶
const ( // Filename into which Config is serialized Filename = "config.yaml" // Repositories is the default directory for repositoires. Repositories = "repositories" // DefaultLanguage is intentionaly undefined. DefaultLanguage = "" // DefaultBuilder is statically defined by the builders package. DefaultBuilder = builders.Default )
Variables ¶
This section is empty.
Functions ¶
func CreatePaths ¶ added in v0.36.0
func CreatePaths() (err error)
CreatePaths is a convenience function for creating the on-disk func config structure. All operations should be tolerant of nonexistant disk footprint where possible (for example listing repositories should not require an extant path, but _adding_ a repository does require that the func config structure exist. Current structure is: ~/.config/func ~/.config/func/repositories
func DefaultNamespace ¶ added in v0.36.0
func DefaultNamespace() (namespace string)
DefaultNamespace for remote operations is the currently active context namespace (if available) or the fallback "default".
func Dir ¶ added in v0.36.0
func Dir() (path string)
Dir is derived in the following order, from lowest to highest precedence.
- The default path is the zero value, indicating "no config path available", and users of this package should act accordingly.
- ~/.config/func if it exists (can be expanded: user has a home dir)
- The value of $XDG_CONFIG_PATH/func if the environment variable exists.
The path is created if it does not already exist.
func File ¶ added in v0.36.0
func File() string
File returns the full path at which to look for a config file. Use FUNC_CONFIG_FILE to override default.
func RepositoriesPath ¶ added in v0.36.0
func RepositoriesPath() string
RepositoriesPath returns the full path at which to look for repositories. Use FUNC_REPOSITORIES_PATH to override default.
Types ¶
type Global ¶ added in v0.36.0
type Global struct { Builder string `yaml:"builder,omitempty"` Confirm bool `yaml:"confirm,omitempty"` Language string `yaml:"language,omitempty"` Namespace string `yaml:"namespace,omitempty"` Registry string `yaml:"registry,omitempty"` Verbose bool `yaml:"verbose,omitempty"` }
Global configuration settings.
func New ¶
func New() Global
New Config struct with all members set to static defaults. See NewDefaults for one which further takes into account the optional config file.
func NewDefault ¶
NewDefault returns a config populated by global defaults as defined by the config file located in .Path() (the global func settings path, which is
usually ~/.config/func).
The config path is not required to be present.
func (Global) Apply ¶ added in v0.36.0
Apply populated values from a function to the config. The resulting config is global settings overridden by a given function.
func (Global) Configure ¶ added in v0.36.0
Configure a function with poipulated values of the config. The resulting function is the function overridden by values on config.
func (Global) RegistryDefault ¶ added in v0.36.0
RegistyDefault is a convenience method for deferred calculation of a default registry taking into account both the global config file and cluster detection.