config

package
v0.0.0-...-a8e4c5d Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config provides configuration for taskrunner.

Config is the exported, usable configuration object, built from ReadConfig.

Internally, the package represents the json file as a separate struct type, configFile. This distinction helps make features like extending configurations easier to support and test.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// WorkingDir is the resolved working directory from the "path" attribute.
	WorkingDir string

	// CaonfigPath is the path to the file from where this config was loaded.
	ConfigPath string

	// DesiredTasks is the set of tasks to run specified by this configuration.
	DesiredTasks []string
}

Config defines user parameters for taskrunner. It is usually loaded via ReadUserConfig or ReadConfig.

func ReadConfig

func ReadConfig(configPath string) (*Config, error)

ReadConfig reads the configuration at configPath and returns a Config.

func ReadDefaultConfig

func ReadDefaultConfig() (*Config, error)

ReadDefaultConfig reads the default configuration from workspace.taskrunner.json. If present, user.taskrunner.json will be used instead.

func (*Config) With

func (c *Config) With(configFile *configFile) (*Config, error)

With extends the base configuration with settings from the input configFile, returning a new config without modifying the original.

Jump to

Keyboard shortcuts

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