config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CONFIG_FOLDER_NAME = ".clc"
View Source
var GetClcHome = func() string {
	clcHome := os.Getenv("CLC_HOME")
	if clcHome != "" {
		return clcHome
	}

	homeDir := os.Getenv(HOME_VAR)
	if homeDir == "" {
		return ""
	}

	return path.Join(homeDir, CONFIG_FOLDER_NAME)
}
View Source
var HOME_VAR = "HOME"

Functions

func CreateIfNotExists

func CreateIfNotExists() error

func Save

func Save(c *Config) error

func SetConfigPathFunc

func SetConfigPathFunc(f func() string)

Types

type Config

type Config struct {
	User              string
	Password          string
	DefaultFormat     string
	Profiles          map[string]Profile
	DefaultDataCenter string
}

func LoadConfig

func LoadConfig() (*Config, error)

type Profile

type Profile struct {
	User     string
	Password string
}

Jump to

Keyboard shortcuts

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