configuration

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HasConsole = isatty.IsTerminal(os.Stdout.Fd()) || isatty.IsCygwinTerminal(os.Stdout.Fd())

HasConsole is set to true if the CLI outputs to a terminal/console

View Source
var IsInteractive = isatty.IsTerminal(os.Stdin.Fd()) || isatty.IsCygwinTerminal(os.Stdin.Fd())

IsInteractive is set to true if the CLI is interactive (it can receive inputs from terminal/console)

View Source
var Settings *viper.Viper

Settings is a global instance of viper holding configurations for the CLI and the gRPC consumers

Functions

func BindFlags

func BindFlags(cmd *cobra.Command, settings *viper.Viper)

BindFlags creates all the flags binding between the cobra Command and the instance of viper

func BuiltinToolsDirectories

func BuiltinToolsDirectories(settings *viper.Viper) paths.PathList

BuiltinToolsDirectories returns all paths that may contains bundled-tools.

func DataDir

func DataDir(settings *viper.Viper) *paths.Path

DataDir returns the full path to the data directory

func DownloadsDir

func DownloadsDir(settings *viper.Viper) *paths.Path

DownloadsDir returns the full path to the download cache directory

func FindConfigFileInArgs

func FindConfigFileInArgs(args []string) string

FindConfigFileInArgs returns the config file path using the argument '--config-file' (if specified) or looking in the current working dir

func GetDefaultBuiltinLibrariesDir

func GetDefaultBuiltinLibrariesDir() string

GetDefaultBuiltinLibrariesDir returns the full path to the default builtin libraries dir

func HardwareDirectories

func HardwareDirectories(settings *viper.Viper) paths.PathList

HardwareDirectories returns all paths that may contains hardware packages.

func IDEBuiltinLibrariesDir

func IDEBuiltinLibrariesDir(settings *viper.Viper) *paths.Path

IDEBuiltinLibrariesDir returns the IDE-bundled libraries path. Usually this directory is present in the Arduino IDE.

func Init

func Init(configFile string) *viper.Viper

Init initialize defaults and read the configuration file. Please note the logging system hasn't been configured yet, so logging shouldn't be used here.

func LibrariesDir

func LibrariesDir(settings *viper.Viper) *paths.Path

LibrariesDir returns the full path to the user directory containing custom libraries

func NetworkProxy

func NetworkProxy(settings *viper.Viper) (*url.URL, error)

NetworkProxy returns the proxy configuration (mainly used by HTTP clients)

func PackagesDir

func PackagesDir(settings *viper.Viper) *paths.Path

PackagesDir returns the full path to the packages folder

func ProfilesCacheDir

func ProfilesCacheDir(settings *viper.Viper) *paths.Path

ProfilesCacheDir returns the full path to the profiles cache directory (it contains all the platforms and libraries used to compile a sketch using profiles)

func SetDefaults

func SetDefaults(settings *viper.Viper)

SetDefaults sets the default values for certain keys

func UserAgent

func UserAgent(settings *viper.Viper) string

UserAgent returns the user agent (mainly used by HTTP clients)

Types

This section is empty.

Jump to

Keyboard shortcuts

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