runtime

package
v0.0.0-...-fcb1709 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 14 Imported by: 30

Documentation

Index

Constants

View Source
const (
	// IPTypePacket represent 'data' type of IP
	IPTypePacket byte = 0x00
	// IPTypeOpenBracket represents '[' type of IP
	IPTypeOpenBracket byte = 0x01
	// IPTypeCloseBracket represents ']' type of IP
	IPTypeCloseBracket byte = 0x02
)

Variables

This section is empty.

Functions

func IsCloseBracket

func IsCloseBracket(ip [][]byte) bool

IsCloseBracket checks if a given IP is ']' IP

func IsOpenBracket

func IsOpenBracket(ip [][]byte) bool

IsOpenBracket checks if a given IP is '[' IP

func IsPacket

func IsPacket(ip [][]byte) bool

IsPacket checks if a given IP is 'data' IP

func IsValidIP

func IsValidIP(ip [][]byte) bool

IsValidIP checks if the given IP contains all required parts (valid)

func NewCloseBracket

func NewCloseBracket() [][]byte

NewCloseBracket is a ']' IP constructor

func NewOpenBracket

func NewOpenBracket() [][]byte

NewOpenBracket is a '[' IP constructor

func NewPacket

func NewPacket(payload []byte) [][]byte

NewPacket is a 'data' IP constructor

Types

type Env

type Env map[string]string

Env is a map of key/values to pass as env variables to a process

type Process

type Process struct {
	Executable  string
	Args        map[string]string
	Env         Env
	Interactive bool
	Stdin       io.Reader
	Stdout      io.Writer
	Stderr      io.Writer
	Root        string
	// contains filtered or unexported fields
}

Process model

func NewProcess

func NewProcess(executable string) (p *Process)

NewProcess is a process constructor

func (*Process) Arguments

func (p *Process) Arguments() string

Arguments returns arguments string for a command

func (*Process) Command

func (p *Process) Command() string

Command returns a process command to execute

func (*Process) Pid

func (p *Process) Pid() int

Pid returns process' pid

func (*Process) Running

func (p *Process) Running() bool

Running returns true is process is running

func (*Process) Signal

func (p *Process) Signal(signal syscall.Signal)

Signal sends signal to a process

func (*Process) Start

func (p *Process) Start()

Start a process

func (*Process) Wait

func (p *Process) Wait()

Wait makes process command's wait

type ProcessIIP

type ProcessIIP struct {
	Payload string
	Socket  string
}

ProcessIIP is a model of IIP (sent when processes started)

type Runtime

type Runtime struct {
	Done  chan bool
	Debug bool
	// contains filtered or unexported fields
}

Runtime structure corresponds to a single network

func NewRuntime

func NewRuntime(registrar library.Registrar, initialTCPPort uint) *Runtime

NewRuntime is a Runtime constructor

func (*Runtime) Activate

func (r *Runtime) Activate()

Activate network by sending out all IIPs

func (*Runtime) LoadGraph

func (r *Runtime) LoadGraph(graphfile string) error

LoadGraph loads graph definition in supported format from a given file path

func (*Runtime) PrintGraph

func (r *Runtime) PrintGraph()

PrintGraph print the current graph for debug purposes

func (*Runtime) Shutdown

func (r *Runtime) Shutdown()

Shutdown the network

func (*Runtime) Start

func (r *Runtime) Start(dry bool)

Start the network based on the current graph

Jump to

Keyboard shortcuts

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