configs

package
v0.0.0-...-0031c6d Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2018 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package configs contains all CLI configurations handling.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	// ConfigFilePath represents the default location of the config file (same directory as executable).
	ConfigFile *paths.Path

	// DataDir represents the current root of the arduino tree (defaulted to `$HOME/.arduino15` on linux).
	DataDir *paths.Path

	// SketchbookDir represents the current root of the sketchbooks tree (defaulted to `$HOME/Arduino`).
	SketchbookDir *paths.Path

	// ArduinoIDEDirectory is the directory of the Arduino IDE if the CLI runs together with it.
	ArduinoIDEDirectory *paths.Path

	// IDEBundledCheckResult contains the result of the check to see if the CLI is bundled with the IDE:
	// the field is true if the CLI is bundled with the Arduino IDE, false if the CLI is running
	// standalone or nil if the detection has not been performed.
	IDEBundledCheckResult *bool

	// BoardManagerAdditionalUrls contains the additional URL for 3rd party packages
	BoardManagerAdditionalUrls []*url.URL

	// ProxyType is the type of proxy configured
	ProxyType string

	// ProxyHostname is the proxy hostname
	ProxyHostname string

	// ProxyUsername is the proxy user
	ProxyUsername string

	// ProxyPassword is the proxy password
	ProxyPassword string
}

Configuration contains a running configuration

func NewConfiguration

func NewConfiguration() (*Configuration, error)

NewConfiguration returns a new Configuration with the default values

func (*Configuration) BundleToolsDirectories

func (config *Configuration) BundleToolsDirectories() (paths.PathList, error)

BundleToolsDirectories returns all paths that may contains bundled-tools.

func (*Configuration) DownloadsDir

func (config *Configuration) DownloadsDir() *paths.Path

DownloadsDir returns the directory for archive downloads.

func (*Configuration) HardwareDirectories

func (config *Configuration) HardwareDirectories() (paths.PathList, error)

HardwareDirectories returns all paths that may contains hardware packages.

func (*Configuration) IDEBundledLibrariesDir

func (config *Configuration) IDEBundledLibrariesDir() *paths.Path

IDEBundledLibrariesDir returns the libraries directory bundled in the Arduino IDE. If there is no Arduino IDE or the directory doesn't exists then nil is returned

func (*Configuration) IndexesDir

func (config *Configuration) IndexesDir() *paths.Path

IndexesDir returns the directory for the indexes

func (*Configuration) IsBundledInDesktopIDE

func (config *Configuration) IsBundledInDesktopIDE() bool

IsBundledInDesktopIDE returns true if the CLI is bundled with the Arduino IDE.

func (*Configuration) LibrariesDir

func (config *Configuration) LibrariesDir() *paths.Path

LibrariesDir returns the directory for installed libraries.

func (*Configuration) LoadFromDesktopIDEPreferences

func (config *Configuration) LoadFromDesktopIDEPreferences() error

LoadFromDesktopIDEPreferences loads the config from the Desktop IDE preferences.txt file

func (*Configuration) LoadFromEnv

func (config *Configuration) LoadFromEnv()

LoadFromEnv read configurations from the environment variables

func (*Configuration) LoadFromYAML

func (config *Configuration) LoadFromYAML(path *paths.Path) error

LoadFromYAML loads the configs from a yaml file.

func (*Configuration) PackagesDir

func (config *Configuration) PackagesDir() *paths.Path

PackagesDir return the directory for installed packages.

func (*Configuration) SaveToYAML

func (config *Configuration) SaveToYAML(path string) error

SaveToYAML the current configuration to a YAML file

func (*Configuration) SerializeToYAML

func (config *Configuration) SerializeToYAML() ([]byte, error)

SerializeToYAML encodes the current configuration as YAML

Jump to

Keyboard shortcuts

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