config

package
v0.9.6-beta Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReadConfigFile = func(filename string) ([]byte, error) {
	f, err := os.Open(filename)
	if err != nil {
		return nil, errors.Wrapf(err, "failed to open '%s'", filename)
	}
	defer f.Close()

	data, err := ioutil.ReadAll(f)
	if err != nil {
		return nil, err
	}

	return data, nil
}

Functions

func WriteDevEnvConfig

func WriteDevEnvConfig(filepath string, cfg DevCtlConfig) error

Types

type DevCtlConfig added in v0.9.0

type DevCtlConfig struct {
	GlobalConfig DevEnvGlobalConfig         `yaml:"global,omitempty" json:"global,omitempty" mapstructure:"global,omitempty"`
	Sdks         map[string]DevEnvSDKConfig `yaml:"sdks,omitempty" json:"sdks,omitempty" mapstructure:"sdks,omitempty"`
}

func DefaultConfig

func DefaultConfig() *DevCtlConfig

DefaultConfig creates a blank *DevCtlConfig

func ParseConfigFile added in v0.9.0

func ParseConfigFile(filename string) (configuration *DevCtlConfig, err error)

func (*DevCtlConfig) GoString added in v0.9.0

func (d *DevCtlConfig) GoString() string

type DevEnvGlobalConfig

type DevEnvGlobalConfig struct {
	Version string `yaml:"version,omitempty" json:"version,omitempty" mapstructure:"version,omitempty"`
}

type DevEnvSDKConfig

type DevEnvSDKConfig struct {
	Current    string         `yaml:"current,omitempty" json:"current,omitempty" mapstructure:"current,omitempty"`
	Candidates []SDKCandidate `yaml:"candidates,omitempty"  json:"candidates,omitempty" mapstructure:"candidates,omitempty"`
}

type SDKCandidate

type SDKCandidate struct {
	Path    string `yaml:"path,omitempty" json:"path,omitempty" mapstructure:"path,omitempty"`
	Version string `yaml:"version,omitempty" json:"version,omitempty" mapstructure:"version,omitempty"`
}

Jump to

Keyboard shortcuts

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