server

package
v0.7.18 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Raw
	Qcow2
	Tap
	HDD    = "HDD"
	CDROM  = "CDROM"
	Local  = "localfs"
	Remote = "URL"
)
View Source
const (
	EtcdName = "corectld.store"
)

Variables

View Source
var (
	RecursiveNameServers = []string{
		"8.8.8.8:53",
		"8.8.4.4:53",
	}
	LocalDomainName = "coreos.local"
	WatermarkHeader = "#\n# This file is automatically generated " +
		"and managed by corectl\n#\n"
	EmbeddedDNSport = "15353"
)
View Source
var (
	// EtcdClientURLs have listeners created and handle etcd API traffic
	EtcdClientURLs = []string{"http://localhost:2379"}

	// EtcdPeerURLs don't have listeners created for them, they are used to pass
	// Etcd validation
	EtcdPeerURLs = []string{"http://0.0.0.0:2380"}
)
View Source
var (
	ErrServerShuttingDown = fmt.Errorf("Request ignored as server is shutting down")
	ErrNothingToShutdown  = fmt.Errorf("Request ignored as no VMs were found running")
	ErrUnknownVM          = fmt.Errorf("Request ignored as no VM with requested name or UUID was found")
)
View Source
var ErrFileIsNotQCOW2 = fmt.Errorf("File doesn't appear to be a qcow one")
View Source
var ServerTimeout = 25 * time.Second

Functions

func HandleVPNtunnels

func HandleVPNtunnels() (f func(), err error)

func PullImage

func PullImage(channel, version string,
	override, preferLocal bool) (v string, err error)

PullImage ...

func Start

func Start() (err error)

Start server...

func ValidateQcow2 added in v0.7.12

func ValidateQcow2(fh *os.File) (err error)

adapted from github.com/vbatts/qcow2/cmd/qcow2-info/main.go

Types

type DNSServer added in v0.7.12

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

func (*DNSServer) PortForward added in v0.7.17

func (dns *DNSServer) PortForward() (err error)

func (*DNSServer) Start added in v0.7.12

func (dns *DNSServer) Start()

func (*DNSServer) Stop added in v0.7.12

func (dns *DNSServer) Stop()

type EtcdServer added in v0.7.12

type EtcdServer struct {
	*etcdserver.EtcdServer
	// contains filtered or unexported fields
}

Etcd is a Server which manages an Etcd cluster

func (*EtcdServer) Start added in v0.7.12

func (e *EtcdServer) Start() (err error)

Starts starts the etcd server and listening for client connections

func (*EtcdServer) Stop added in v0.7.12

func (e *EtcdServer) Stop()

Stop closes all connections and stops the Etcd server

type MediaAssets

type MediaAssets map[string]semver.Versions

MediaAssets ...

type NetworkInterface

type NetworkInterface struct {
	Type int
	// if/when tap...
	Path string `json:",omitempty"`
}

NetworkInterface ...

type RPCquery

type RPCquery struct {
	Input  []string
	Forced bool
	VM     *VMInfo
}

type RPCreply

type RPCreply struct {
	Output     []string
	Meta       *release.Info
	VM         *VMInfo
	Images     map[string]semver.Versions
	Running    VMmap
	WorkingNFS bool
}

func RPCQuery

func RPCQuery(f string, args *RPCquery) (reply *RPCreply, err error)

type RPCservice

type RPCservice struct{}

func (*RPCservice) ActiveVMs

func (s *RPCservice) ActiveVMs(r *http.Request,
	args *RPCquery, reply *RPCreply) (err error)

func (*RPCservice) AvailableImages

func (s *RPCservice) AvailableImages(r *http.Request,
	args *RPCquery, reply *RPCreply) (err error)

func (*RPCservice) Echo

func (s *RPCservice) Echo(r *http.Request,
	args *RPCquery, reply *RPCreply) (err error)

func (*RPCservice) HandlesNFS added in v0.7.14

func (s *RPCservice) HandlesNFS(r *http.Request,
	args *RPCquery, reply *RPCreply) (err error)

func (*RPCservice) RemoveImage

func (s *RPCservice) RemoveImage(r *http.Request,
	args *RPCquery, reply *RPCreply) (err error)

func (*RPCservice) Run

func (s *RPCservice) Run(r *http.Request,
	args *RPCquery, reply *RPCreply) (err error)

func (*RPCservice) Stop

func (s *RPCservice) Stop(r *http.Request,
	args *RPCquery, reply *RPCreply) (err error)

func (*RPCservice) StopVMs

func (s *RPCservice) StopVMs(r *http.Request,
	args *RPCquery, reply *RPCreply) (err error)

func (*RPCservice) UUIDtoMACaddr

func (s *RPCservice) UUIDtoMACaddr(r *http.Request,
	args *RPCquery, reply *RPCreply) (err error)

type ServerContext added in v0.7.1

type ServerContext struct {
	Meta              *release.Info
	Media             MediaAssets
	Active            VMmap
	APIserver         *manners.GracefulServer
	EtcdServer        *EtcdServer
	EtcdClient        client.KeysAPI
	DNSServer         *DNSServer
	Jobs              sync.WaitGroup
	AcceptingRequests bool
	WorkingNFS        bool
	Oops              chan error
	sync.Mutex
}

Config ...

var Daemon *ServerContext

func New

func New() (cfg *ServerContext)

New ...

func (*ServerContext) NewDNSServer added in v0.7.12

func (d *ServerContext) NewDNSServer(root,
	serverAddress string, ns []string) (err error)

func (*ServerContext) NewEtcd added in v0.7.12

func (d *ServerContext) NewEtcd(clientURLStrs,
	peerURLStrs []string, name, dataDirectory string) error

NewEtcd creates a new default etcd Server using 'dataDir' for persistence. Panics if could not be configured.

func (*ServerContext) Running added in v0.7.1

func (cfg *ServerContext) Running() (i *release.Info, err error)

type StorageAssets

type StorageAssets struct {
	CDDrives, HardDrives map[string]StorageDevice `json:",omitempty"`
}

StorageAssets ...

func (*StorageAssets) PrettyPrint

func (volumes *StorageAssets) PrettyPrint(root bool)

type StorageDevice

type StorageDevice struct {
	Slot, Format int
	Type, Path   string
}

StorageDevice ...

type VMInfo

type VMInfo struct {
	Name, Channel, Version, UUID            string
	MacAddress, PublicIP                    string
	InternalSSHkey, InternalSSHprivate      string
	Cpus, Memory, Pid                       int
	SSHkey, CloudConfig, CClocation         string `json:",omitempty"`
	AddToHypervisor, AddToKernel            string `json:",omitempty"`
	Ethernet                                []NetworkInterface
	Storage                                 StorageAssets `json:",omitempty"`
	SharedHomedir, OfflineMode, NotIsolated bool
	FormatRoot, PersistentRoot              bool
	CreationTime                            time.Time
	// contains filtered or unexported fields
}

VMInfo - per VM settings

func (*VMInfo) Log

func (vm *VMInfo) Log() string

func (*VMInfo) MkRunDir

func (vm *VMInfo) MkRunDir() error

func (*VMInfo) PrettyPrint

func (vm *VMInfo) PrettyPrint()

func (*VMInfo) RunDir

func (vm *VMInfo) RunDir() string

func (*VMInfo) SSHkeyGen

func (vm *VMInfo) SSHkeyGen() (err error)

SSHkeyGen creates a one-time ssh public and private key pair

func (*VMInfo) TTY

func (vm *VMInfo) TTY() string

func (*VMInfo) ValidateCDROM

func (vm *VMInfo) ValidateCDROM(path string) (err error)

ValidateCDROM ...

func (*VMInfo) ValidateCloudConfig

func (vm *VMInfo) ValidateCloudConfig(config string) (err error)

ValidateCloudConfig ...

func (*VMInfo) ValidateVolumes

func (vm *VMInfo) ValidateVolumes(volumes []string, root bool) (err error)

ValidateVolumes ...

type VMmap added in v0.7.15

type VMmap map[string]*VMInfo

type VMs added in v0.7.15

type VMs []*VMInfo

Config ...

func (VMs) Len added in v0.7.15

func (run VMs) Len() int

func (VMs) Less added in v0.7.15

func (run VMs) Less(i, j int) bool

func (VMs) Swap added in v0.7.15

func (run VMs) Swap(i, j int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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