cliconfig

package
v3.70.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package cliconfig provides a configuration file loader.

It is intended for internal use by buildkite-agent only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	// The path to the file
	Path string

	// A map of key/values that was loaded from the file
	Config map[string]string
}

func (File) AbsolutePath

func (f File) AbsolutePath() (string, error)

func (File) Exists

func (f File) Exists() bool

func (*File) Load

func (f *File) Load() error

type Loader

type Loader struct {
	// The context that is passed when using a urfave/cli action
	CLI *cli.Context

	// The struct that the config values will be loaded into
	Config any

	// The logger used
	Logger logger.Logger

	// A slice of paths to files that should be used as config files
	DefaultConfigFilePaths []string

	// The file that was used when loading this configuration
	File *File
}

func (Loader) Errorf

func (l Loader) Errorf(format string, v ...any) error

func (*Loader) Load

func (l *Loader) Load() (warnings []string, err error)

Loads the config from the CLI and config files that are present and returns any warnings or errors

Jump to

Keyboard shortcuts

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