config

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Verbose toggles the verbosity
	Verbose bool
	// File...
	File string
	// Path ...
	Path string
	// FileMode ...
	FileMode os.FileMode
	// Flags ...
	Flags *Flags
	// Stdin ...
	Stdin *os.File
	// Stdout ...
	Stdout *os.File
	// Stderr ...
	Stderr *os.File
	// Spec ...
	Spec *spec.Spec
	// Plugin ...
	Plugin string

	sync.RWMutex
}

Config contains the configuration.

func New

func New() *Config

New returns a new config.

func (*Config) Cwd

func (c *Config) Cwd() (string, error)

Cwd returns the current working directory.

func (*Config) HomeDir

func (c *Config) HomeDir() (string, error)

HomeDir returns the home directory.

func (*Config) InitDefaultConfig

func (c *Config) InitDefaultConfig() error

InitDefaultConfig initializes the default configuration.

func (*Config) LoadSpec

func (c *Config) LoadSpec() error

LoadSpec is a helper to load the spec from the config file.

func (*Config) UsePlugin added in v0.5.0

func (c *Config) UsePlugin() bool

UsePlugin returns true if the plugin is set.

func (*Config) Vars added in v0.5.0

func (c *Config) Vars() []string

Vars returns the variables.

type Flags

type Flags struct {
	// Dry toggles the dry run mode.
	Dry bool
	// Force toggles the force mode.
	Force bool
	// Root runs the command as root.
	Root bool
	// Verbose toggles the verbosity.
	Verbose bool
	// Version toggles the version.
	Version bool
	// Plugin uses a plugin as storage provider.
	Plugin string
	// Vars captures the variables.
	Vars []string
}

Flags contains the command line flags.

func NewFlags added in v0.5.0

func NewFlags() *Flags

NewFlags returns a new flags.

Jump to

Keyboard shortcuts

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