hyperstart

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2016 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	Version        = "version"
	StartPod       = "startpod"
	DestroyPod     = "destroypod"
	ExecCmd        = "execcmd"
	Ready          = "ready"
	Ack            = "ack"
	Error          = "error"
	WinSize        = "winsize"
	Ping           = "ping"
	FinishPod      = "finishpod"
	Next           = "next"
	WriteFile      = "writefile"
	ReadFile       = "readfile"
	NewContainer   = "newcontainer"
	KillContainer  = "killcontainer"
	OnlineCPUMem   = "onlinecpumem"
	SetupInterface = "setupinterface"
	SetupRoute     = "setuproute"
)

Control command IDs Need to be in sync with hyperstart/src/api.h

Variables

This section is empty.

Functions

func FormatMessage

func FormatMessage(payload interface{}) ([]byte, error)

FormatMessage formats hyperstart messages.

func ReadIoMessageWithConn added in v0.2.0

func ReadIoMessageWithConn(conn net.Conn) (*hyper.TtyMessage, error)

ReadIoMessageWithConn returns data coming from the specified IO channel.

func SendIoMessageWithConn added in v0.2.0

func SendIoMessageWithConn(conn net.Conn, ttyMsg *hyper.TtyMessage) error

SendIoMessageWithConn sends data to the specified IO channel.

Types

type Hyperstart

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

Hyperstart is the base structure for hyperstart.

func NewHyperstart

func NewHyperstart(ctlSerial, ioSerial, sockType string) *Hyperstart

NewHyperstart returns a new hyperstart structure.

func (*Hyperstart) CloseSockets

func (h *Hyperstart) CloseSockets() error

CloseSockets closes both CTL and IO sockets.

func (*Hyperstart) IsStarted

func (h *Hyperstart) IsStarted() bool

IsStarted returns about connection status.

func (*Hyperstart) OpenSockets

func (h *Hyperstart) OpenSockets() error

OpenSockets opens both CTL and IO sockets.

func (*Hyperstart) ReadIoMessage

func (h *Hyperstart) ReadIoMessage() (*hyper.TtyMessage, error)

ReadIoMessage returns data coming from the IO channel.

func (*Hyperstart) SendCtlMessage

func (h *Hyperstart) SendCtlMessage(cmd string, data []byte) (*hyper.DecodedMessage, error)

SendCtlMessage sends a message to the CTL channel.

func (*Hyperstart) SendIoMessage

func (h *Hyperstart) SendIoMessage(ttyMsg *hyper.TtyMessage) error

SendIoMessage sends data to the IO channel.

func (*Hyperstart) SetDeadline

func (h *Hyperstart) SetDeadline(t time.Time) error

SetDeadline sets a timeout for CTL connection.

func (*Hyperstart) WaitForReady

func (h *Hyperstart) WaitForReady() error

WaitForReady waits for a READY message on CTL channel.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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