server

package
v0.0.0-...-b4b3e54 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2015 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Verbose bool = false
)

Functions

func Send

func Send(packet Packet, serveraddress string) (exitcode int)

Sends a message that consists of a Packet struct to a specified server.

Types

type Container

type Container struct {
	Id                 int
	Cores, Memory      int
	Cpulevel, Ramlevel int
	Timetolive         int
}

func (*Container) String

func (container *Container) String() string

type MsgType

type MsgType uint8
const (
	Newserver MsgType = iota
	ContainerRequest
	ContainerAllocation
	ServerUsage
	ServerList
	CallForProposals
	Proposal
	Accepted
	Rejected
	Migration
	MigrationDone
)

type Packet

type Packet struct {
	Msgtype   MsgType
	Container *Container
	Server    *Server
}

type Server

type Server struct {
	Id, Cores, Memory, Cpulevel, Ramlevel int
	Cputhreshold, Ramthreshold            int
	Servertype                            ServerType
	Address, Manageraddress               string
	Containers                            []*Container
	// contains filtered or unexported fields
}

func NewServer

func NewServer(id, cores, memory int, address, manageraddress string, servertype ServerType) *Server

Constructs a new SS.

func (*Server) Run

func (server *Server) Run()

Sets up handling for incoming connections and run monitoring goroutines.

type ServerType

type ServerType uint8
const (
	HighCPU    ServerType = iota // = 0 (compute intensive)
	HighMemory                   // = 1 (memory intensive)
	Combined                     // = 2 (combined)
)

Jump to

Keyboard shortcuts

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