mock

package
v0.0.0-...-205ecf7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectShim

type ConnectShim struct {
	Token string `json:"token"`
}

ConnectShim payload defined here, as it has not been defined in proxy api package yet

type FrameKey

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

FrameKey is a struct composed of the the frame type and opcode, used as a key for retrieving the handler for handling the frame.

type Proxy

type Proxy struct {
	ShimConnected    chan bool
	Signal           chan ShimSignal
	ShimDisconnected chan bool
	StdinReceived    chan bool
	// contains filtered or unexported fields
}

Proxy is an object mocking clearcontainers Proxy

func NewProxy

func NewProxy(t *testing.T, path string) *Proxy

NewProxy creates a hyperstart instance

func (*Proxy) GetLastStdinStream

func (proxy *Proxy) GetLastStdinStream() []byte

GetLastStdinStream returns the last received stdin stream

func (*Proxy) GetProxyToken

func (proxy *Proxy) GetProxyToken() string

GetProxyToken returns the token that mock proxy uses to verify its client connection

func (*Proxy) SendExitNotification

func (proxy *Proxy) SendExitNotification(payload []byte)

SendExitNotification sends an Exit Notification Frame to connected client

func (*Proxy) SendStderrStream

func (proxy *Proxy) SendStderrStream(payload []byte)

SendStderrStream sends a Stderr Stream Frame to connected client

func (*Proxy) SendStdoutStream

func (proxy *Proxy) SendStdoutStream(payload []byte)

SendStdoutStream sends a Stdout Stream Frame to connected client

func (*Proxy) Start

func (proxy *Proxy) Start()

Start invokes mock proxy instance to start listening.

func (*Proxy) Stop

func (proxy *Proxy) Stop()

Stop causes mock proxy instance to stop listening, close connection to client and close all channels

type ShimSignal

type ShimSignal struct {
	Signal int `json:"signalNumber"`
	Row    int `json:"rows,omitempty"`
	Column int `json:"columns,omitempty"`
}

ShimSignal is the struct used to represent the signal received from the shim

Jump to

Keyboard shortcuts

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