config

package
v0.16.10 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2015 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (

	//
	AppDir     string // the path to the application (~/.nanobox/apps/<app>)
	AppsDir    string // ~/.nanobox/apps
	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's root directory path (~/.nanobox)
	UpdateFile string // the path to the .update file (~/.nanobox/.update)

	//
	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   //
	Devmode    bool   //
	Force      bool   //
	Verbose    bool   //
	Silent     bool   //
	LogLevel   string //

	//
	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
	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
}

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