config

package
v0.16.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VERSION = "0.16.4"

	SERVER_PORT = ":1757"
	MIST_PORT   = ":1445"
	LOGTAP_PORT = ":6361"
)

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
)

Functions

func Debug

func Debug(msg string, debug bool)

Debug

func Error

func Error(msg, err string)

Error

func Fatal

func Fatal(msg, err string)

Fatal

func Info

func Info(msg string)

Info

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() *BoxfileConfig

ParseBoxfile

type Config

type Config interface {
	Fatal(string, string)
	Root() string
	ParseConfig(path string, v interface{}) error
	Debug(msg string, debug bool)
	Info(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
	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
}

NanofileConfig represents all available/expected .nanofile configurable options

func ParseNanofile

func ParseNanofile() *NanofileConfig

ParseNanofile

type VMfileConfig

type VMfileConfig struct {
	Deployed    bool   // was the most recent deploy successufl
	Mode        string // foreground/background
	Status      string // the current staus of the VM
	Suspendable bool   // is the VM able to be suspended
}

VMfileConfig represents all available/expected .vmfile configurable options

func ParseVMfile

func ParseVMfile() *VMfileConfig

ParseVMfile

func (*VMfileConfig) DeployedIs

func (c *VMfileConfig) DeployedIs(deployed bool)

func (*VMfileConfig) HasDeployed

func (c *VMfileConfig) HasDeployed() bool

func (*VMfileConfig) IsMode

func (c *VMfileConfig) IsMode(mode string) bool

func (*VMfileConfig) IsSuspendable

func (c *VMfileConfig) IsSuspendable() bool

func (*VMfileConfig) ModeIs

func (c *VMfileConfig) ModeIs(mode string)

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