config

package
v1.0.0-beta.7 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 7 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 {
	// HomePath - path to store the configuration files, this path is set by default based on the operating system type
	// and your user's home directory. Typically, this is set to $HOME/.distillery
	HomePath string `yaml:"home_path" toml:"home_path"`

	// BinPath - path to create symlinks for your binaries, this path is set by default based on the operating system type
	// This is the path that is added to your PATH environment variable. Typically, this is set to $HOME/.distillery/bin
	BinPath string `yaml:"bin_path" toml:"bin_path"`

	// OptPath - path to store the binaries that are installed, this path is set by default based on the operating
	// system type. This is where the symlinks in the BinPath point to. Typically, this is set to $HOME/.distillery/opt
	OptPath string `yaml:"opt_path" toml:"opt_path"`

	// CachePath - path to store cache files, this path is set by default based on the operating system type
	CachePath string `yaml:"cache_path" toml:"cache_path"`

	// DefaultSource - the default source to use when installing binaries, this defaults to GitHub
	DefaultSource string `yaml:"default_source" toml:"default_source"`

	// AutomaticAliases - automatically create aliases for any binary that is installed
	AutomaticAliases bool `yaml:"automatic_aliases" toml:"automatic_aliases"`

	// Aliases - Allow for creating shorthand aliases for source locations that you use frequently. A good example
	// of this is `distillery` -> `ekristen/distillery`
	Aliases map[string]string `yaml:"aliases" toml:"aliases"`

	// Language - the language to use for the output of the application
	Language string `yaml:"language" toml:"language"`
}

func New

func New(path string) (*Config, error)

New - create a new configuration object

func (*Config) GetCachePath

func (c *Config) GetCachePath() string

func (*Config) GetDownloadsPath

func (c *Config) GetDownloadsPath() string

func (*Config) GetMetadataPath

func (c *Config) GetMetadataPath() string

func (*Config) Load

func (c *Config) Load(path string) error

Load - load the configuration file

func (*Config) MkdirAll

func (c *Config) MkdirAll() error

Jump to

Keyboard shortcuts

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