cluster

package
v0.0.0-...-1d4c075 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2016 License: BSD-3-Clause Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IFNAMSIZ      = 16
	IFF_TAP       = 0x0002
	IFF_NO_PI     = 0x1000
	TUNSETIFF     = 0x400454ca
	TUNSETPERSIST = 0x400454cb
	TUNSETOWNER   = 0x400454cc
	TUNSETGROUP   = 0x400454ce
)

Variables

This section is empty.

Functions

func BuildFlynn

func BuildFlynn(bc BootConfig, rootFS, commit string, merge bool, out io.Writer) (string, error)

Types

type BootConfig

type BootConfig struct {
	User     string
	Kernel   string
	Network  string
	NatIface string
}

type BootResult

type BootResult struct {
	ControllerDomain string
	ControllerPin    string
	ControllerKey    string
	Instances        []*Instance
}

type Bridge

type Bridge struct {
	// contains filtered or unexported fields
}

func (*Bridge) IP

func (b *Bridge) IP() string

type Cluster

type Cluster struct {
	ID            string    `json:"id"`
	Instances     instances `json:"instances"`
	ClusterDomain string    `json:"cluster_domain"`
	ControllerPin string    `json:"controller_pin"`
	ControllerKey string    `json:"controller_key"`
	RouterIP      string    `json:"router_ip"`
	// contains filtered or unexported fields
}

func New

func New(bc BootConfig, out io.Writer) *Cluster

func (*Cluster) AddHost

func (c *Cluster) AddHost() (*Instance, error)

func (*Cluster) AddVanillaHost

func (c *Cluster) AddVanillaHost(rootFS string) (*Instance, error)

func (*Cluster) Boot

func (c *Cluster) Boot(typ ClusterType, count int, buildLog *buildlog.Log, killOnFailure bool) (res *BootResult, err error)

func (*Cluster) BridgeIP

func (c *Cluster) BridgeIP() string

func (*Cluster) BuildFlynn

func (c *Cluster) BuildFlynn(rootFS, commit string, merge bool, runTests bool) (string, error)

func (*Cluster) CLIConfig

func (c *Cluster) CLIConfig() (*config.Config, error)

func (*Cluster) ControllerDomain

func (c *Cluster) ControllerDomain() string

func (*Cluster) DumpLogs

func (c *Cluster) DumpLogs(buildLog *buildlog.Log)

func (*Cluster) GitDomain

func (c *Cluster) GitDomain() string

func (*Cluster) RemoveHost

func (c *Cluster) RemoveHost(id string) error

RemoveHost stops flynn-host on the instance but leaves it running so the logs are still available if we need to dump them later.

func (*Cluster) Run

func (c *Cluster) Run(command string, s *Streams) error

func (*Cluster) RunWithEnv

func (c *Cluster) RunWithEnv(command string, s *Streams, env map[string]string) error

func (*Cluster) Shutdown

func (c *Cluster) Shutdown()

func (*Cluster) Size

func (c *Cluster) Size() int

type ClusterType

type ClusterType uint8
const (
	ClusterTypeDefault ClusterType = iota
	ClusterTypeRelease
	ClusterTypeNone
)

type Instance

type Instance struct {
	ID string `json:"id"`
	IP string `json:"ip"`

	*VMConfig
	// contains filtered or unexported fields
}

func (*Instance) Drive

func (i *Instance) Drive(name string) *VMDrive

func (*Instance) Kill

func (i *Instance) Kill() error

func (*Instance) Run

func (i *Instance) Run(command string, s *Streams) error

func (*Instance) RunWithEnv

func (i *Instance) RunWithEnv(command string, s *Streams, env map[string]string) error

func (*Instance) RunWithTimeout

func (i *Instance) RunWithTimeout(command string, s *Streams, timeout time.Duration) error

func (*Instance) Shutdown

func (i *Instance) Shutdown() error

func (*Instance) Start

func (i *Instance) Start() error

func (*Instance) Wait

func (i *Instance) Wait(timeout time.Duration) error

type Streams

type Streams struct {
	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
}

type Tap

type Tap struct {
	Name string
	IP   net.IP
	// contains filtered or unexported fields
}

func (*Tap) Close

func (t *Tap) Close() error

func (*Tap) WriteInterfaceConfig

func (t *Tap) WriteInterfaceConfig(f io.Writer) error

type TapManager

type TapManager struct {
	// contains filtered or unexported fields
}

func (*TapManager) NewTap

func (t *TapManager) NewTap(uid, gid int) (*Tap, error)

type VMConfig

type VMConfig struct {
	Kernel string
	User   int
	Group  int
	Memory string
	Cores  int
	Drives map[string]*VMDrive
	Args   []string
	Out    io.Writer `json:"-"`
	// contains filtered or unexported fields
}

type VMDrive

type VMDrive struct {
	FS   string
	COW  bool
	Temp bool
}

type VMManager

type VMManager struct {
	// contains filtered or unexported fields
}

func NewVMManager

func NewVMManager(bridge *Bridge) *VMManager

func (*VMManager) NewInstance

func (v *VMManager) NewInstance(c *VMConfig) (*Instance, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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