config

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2015 License: MPL-2.0 Imports: 15 Imported by: 60

Documentation

Index

Constants

View Source
const (
	OS          = runtime.GOOS
	ARCH        = runtime.GOARCH
	LOGTAP_PORT = ":6361"
	MIST_PORT   = ":1445"
	SERVER_PORT = ":1757"
	VERSION     = "0.17.1"
)

Variables

View Source
var (

	//
	AppDir     string // ~/.nanobox/apps/<app>; the path to the application
	AppsDir    string // ~/.nanobox/apps; the path where 'apps' are stored
	CWDir      string // the current working directory
	EnginesDir string // ~/.nanobox/engines
	Home       string // the users home directory (~)
	IP         string // the guest vm's private network ip (generated from app name)
	Root       string // ~/.nanobox; nanobox's root directory path
	TmpDir     string // ~/.nanobox/tmp; a place to put downloads before moving them
	UpdateFile string // ~/.nanobox/.update; the path to the .update file

	//
	Nanofile NanofileConfig // parsed nanofile options
	VMfile   VMfileConfig   // parsed nanofile options

	//
	ServerURI string // nanobox-server host:port combo (IP:1757)
	ServerURL string // nanobox-server host:port combo (IP:1757) (http)
	MistURI   string // mist's host:port combo (IP:1445)
	LogtapURI string // logtap's host:port combo (IP:6361)

	// flags
	Background bool   // don't suspend the vm on exit
	Devmode    bool   // run nanobox in devmode
	Force      bool   // force a command to run (effects very per command)
	LogLevel   string //
	Silent     bool   // silence all ouput
	Verbose    bool   // run cli with log level "debug"

	//
	Exit exiter = os.Exit
)
View Source
var (
	Console *lumber.ConsoleLogger
	Log     *lumber.FileLogger
	LogFile string
)

Functions

func Debug

func Debug(msg string)

Debug

func Error

func Error(msg, err string)

Error

func Fatal

func Fatal(msg, err string)

Fatal

func ParseConfig

func ParseConfig(path string, v interface{}) error

ParseConfig

Types

type BoxfileConfig

type BoxfileConfig struct {
	Build struct {
		Engine string `json:"engine"`
	}
}

BoxfileConfig represents all available/expected Boxfile configurable options

func ParseBoxfile

func ParseBoxfile() (boxfile BoxfileConfig)

ParseBoxfile

type Config

type Config interface {
	Fatal(string, string)
	Root() string
	ParseConfig(path string, v interface{}) error
	Debug(msg string)
	Error(msg, err string)
	ParseNanofile() NanofileConfig
	ParseVMfile() VMfileConfig
}
var (
	Default Config = config{}
)

type NanofileConfig

type NanofileConfig struct {
	CPUCap    int    `json:"cpu_cap"`    // max %CPU usage allowed to the guest vm
	CPUs      int    `json:"cpus"`       // number of CPUs to dedicate to the guest vm
	DevConfig string `json:"dev_config"` // the type of dev environment to configure on the guest vm
	Domain    string `json:"domain"`     // the domain to use in conjuntion with the ip when accesing the guest vm (defaults to <Name>.dev)
	IP        string `json:"ip"`         // the ip added to the /etc/hosts file for accessing the guest vm
	MountNFS  bool   `json:"mount_nfs"`  // does the code directory get mounted as NFS
	Name      string `json:"name"`       // the name given to the project (defaults to cwd)
	Provider  string `json:"provider"`   // guest vm provider (virtual box, vmware, etc)
	RAM       int    `json:"ram"`        // ammount of RAM to dedicate to the guest vm
	HostDNS   string `json:"host_dns"`   // use the hosts dns resolver
	SshPath   string `json:"ssh_path"`   // provide the path to the .ssh directory (if any)
}

NanofileConfig represents all available/expected .nanofile configurable options

func ParseNanofile

func ParseNanofile() NanofileConfig

ParseNanofile

type VMfileConfig

type VMfileConfig struct {
	Background  bool // is the CLI running in "background" mode
	Deployed    bool // was the most recent deploy successufl
	Reloaded    bool // did the previous CLI command cause a 'reload'
	Suspendable bool // is the VM able to be suspended
}

VMfileConfig represents all available/expected .vmfile configurable options

func ParseVMfile

func ParseVMfile() (vmfile VMfileConfig)

ParseVMfile

func (*VMfileConfig) BackgroundIs added in v0.16.6

func (c *VMfileConfig) BackgroundIs(background bool)

func (*VMfileConfig) DeployedIs

func (c *VMfileConfig) DeployedIs(deployed bool)

func (*VMfileConfig) HasDeployed

func (c *VMfileConfig) HasDeployed() bool

func (*VMfileConfig) HasReloaded added in v0.16.6

func (c *VMfileConfig) HasReloaded() bool

func (*VMfileConfig) IsBackground added in v0.16.6

func (c *VMfileConfig) IsBackground() bool

func (*VMfileConfig) IsSuspendable

func (c *VMfileConfig) IsSuspendable() bool

func (*VMfileConfig) ReloadedIs added in v0.16.6

func (c *VMfileConfig) ReloadedIs(reloaded bool)

func (*VMfileConfig) SuspendableIs

func (c *VMfileConfig) SuspendableIs(suspendable bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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