Documentation ¶
Index ¶
- Constants
- func FormatMessage(payload interface{}) ([]byte, error)
- func ReadIoMessageWithConn(conn net.Conn) (*hyper.TtyMessage, error)
- func SendIoMessageWithConn(conn net.Conn, ttyMsg *hyper.TtyMessage) error
- type Hyperstart
- func (h *Hyperstart) CloseSockets() error
- func (h *Hyperstart) IsStarted() bool
- func (h *Hyperstart) OpenSockets() error
- func (h *Hyperstart) ReadIoMessage() (*hyper.TtyMessage, error)
- func (h *Hyperstart) SendCtlMessage(cmd string, data []byte) (*hyper.DecodedMessage, error)
- func (h *Hyperstart) SendIoMessage(ttyMsg *hyper.TtyMessage) error
- func (h *Hyperstart) SetDeadline(t time.Time) error
- func (h *Hyperstart) WaitForReady() error
Constants ¶
const ( Version = "version" StartPod = "startpod" GetPod = "getpod" DestroyPod = "destroypod" RestartContainer = "restartcontainer" ExecCmd = "execcmd" FinishCmd = "finishcmd" 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 ¶
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.