config

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: BSD-3-Clause-Clear Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OutputJSON   = "json"
	OutputStyled = "styled"
)

Variables

View Source
var (
	// AppName is the name of the application
	// Note: use caution when renaming as it is used in various places within the CLI including for
	// config file naming and in the profile store
	AppName = "otdfctl"

	Version   = "0.0.0"
	BuildTime = "1970-01-01T00:00:00Z"
	CommitSha = "0000000"

	// Test mode is used to determine if the application is running in test mode
	//   "true" = running in test mode
	TestMode = ""

	// Test terminal size is a runtime env var to allow for testing of terminal output
	TEST_TERMINAL_WIDTH = "TEST_TERMINAL_WIDTH"
)
View Source
var ErrLoadingConfig = errors.New("error loading config")

Functions

func UpdateOutputFormat

func UpdateOutputFormat(cfgKey, format string) error

Types

type Config

type Config struct {
	Output Output `yaml:"output"`
}

func LoadConfig

func LoadConfig(file string, key string) (*Config, error)

Load config with viper. TODO force creation of the config in the `~/.config/otdfctl` directory TODO the config file in gh is config.yaml -- might want to emulate this

type ConfigFlagOverrides

type ConfigFlagOverrides struct {
	OutputFormatJSON bool
}

captures all CLI flags that will override pre-specified config values

type Output

type Output struct {
	Format string `yaml:"format" default:"styled"`
}

Jump to

Keyboard shortcuts

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