environment

package
v0.0.0-...-ced39b3 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const SETTINGSFILE = "settings.json"

SETTINGSFILE is the name of the file where the settings are stored.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(baseFolder string) (map[string]Config, error)

LoadConfig will load Config files in the given location

Types

type Config

type Config struct {
	// Name holds the name of the environment.
	Name string `json:"name"`
	// CompileSteps hold the commands to be run to compile this env main project.
	CompileSteps []string `json:"compilesteps"`
	// GoVersion holds the version of go this env should use.
	GoVersion string `json:"goversion"`
	// GlobalBin indicates if the $GOPATH/bin of this env will be added to PATH.
	GlobalBin bool `json:"globalbin"`
	// GoPath
	GoPath string `json:"gopath"`
	// contains filtered or unexported fields
}

Config holds the information about a given environment.

func (*Config) Save

func (c *Config) Save(baseFolder string) error

Save serializes and writes the Config in a file in the passed folder.

func (Config) Set

func (c Config) Set(attribute, value string) error

Set will set the value of <attribute> to <value> if attribute is a valid member of Config.

type Settings

type Settings struct {
	// Goroot is the path to a working goroot, it is
	// required by the go compiler.
	// TODO (perrito666) make this updateable by each new version.
	Goroot string `json:"goroot"`
	// Default is the default environment to set, this will behave
	// a bit differently since its for general use.
	Default string `json:"default"`
	// contains filtered or unexported fields
}

Settings holds general settings for goworkon.

func LoadSettings

func LoadSettings(baseFolder string) (Settings, error)

LoadSettings will load Settings files in the given location

func (Settings) Save

func (s Settings) Save(baseFolder string) error

Save serializes and writes the Settings in a file in the passed folder.

func (Settings) Set

func (s Settings) Set(attribute, value string) error

Set will set the value of <attribute> to <value> if attribute is a valid member of Settings.

Jump to

Keyboard shortcuts

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