deploy

package
v0.0.0-...-33e3a13 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bridge

type Bridge struct {
	Netns string
	Veths []string
}

Bridge is a bridge in a network namespace

func NewBridge

func NewBridge() *Bridge

NewBridge returns a new bridge

func (*Bridge) Start

func (b *Bridge) Start()

Start starts the bridge

func (*Bridge) Stop

func (b *Bridge) Stop()

Stop stops the bridge

type Deploy

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

Deploy is a deployment of a topology

func GetDeploy

func GetDeploy(name string) *Deploy

GetDeploy returns the deployment identified by name

func GetDeploys

func GetDeploys() []*Deploy

GetDeploys returns all deployments

func NewDeploy

func NewDeploy(t *topo.Topology) *Deploy

NewDeploy returns a new deployment for t

func (*Deploy) RunCmd

func (d *Deploy) RunCmd(node, cmd string)

RunCmd runs cmd on node in the deployment

func (*Deploy) Start

func (d *Deploy) Start(force bool)

Start starts the deployment

func (*Deploy) Status

func (d *Deploy) Status() Status

Status returns the status of the deployment

func (*Deploy) Stop

func (d *Deploy) Stop(force bool)

Stop stops the deployment

func (*Deploy) Topology

func (d *Deploy) Topology() *topo.Topology

Topology returns the topology of the deployment

type Netns

type Netns struct {
	Name string
}

Netns is a network namespace

func NewNetns

func NewNetns() *Netns

NewNetns returns a new network namespace

func (*Netns) Start

func (n *Netns) Start()

Start starts the network namespace

func (*Netns) Status

func (n *Netns) Status() Status

Status returns the status of the network namespace

func (*Netns) Stop

func (n *Netns) Stop()

Stop stops the network namespace

type Route

type Route struct {
	Netns string
	Route *topo.Route
}

Route is a routing table entry in a network namespace

func NewRoute

func NewRoute() *Route

NewRoute returns a new route

func (*Route) Start

func (r *Route) Start()

Start configures the route

func (*Route) Stop

func (r *Route) Stop()

Stop removes the route

type Router

type Router struct {
	Netns string
}

Router is a router in a network namespace

func NewRouter

func NewRouter() *Router

NewRouter returns a new router

func (*Router) Start

func (r *Router) Start()

Start starts the router

func (*Router) Stop

func (r *Router) Stop()

Stop stops the router

type Run

type Run struct {
	Netns    string
	Commands []string
}

Run is a list of commands to run in a network namespace

func NewRun

func NewRun() *Run

NewRun returns a new list of commands to run

func (*Run) Start

func (r *Run) Start()

Start executes the commands

func (*Run) Stop

func (r *Run) Stop()

Stop stops the commands

type Status

type Status uint8

Status is a deployment status

const (
	StatusUnknown Status = iota
	StatusInactive
	StatusPartial
	StatusActive
	StatusInvalid
)

Status codes for the deployment status

func (Status) String

func (s Status) String() string

String returns the status as a string

type Veth

type Veth struct {
	Name  string
	Netns [2]string
	MACs  [2]string
	IPs   [2]string
}

Veth is a veth device

func NewVeth

func NewVeth() *Veth

NewVeth returns a new veth device

func (*Veth) Start

func (v *Veth) Start()

Start starts the veth device

func (*Veth) Stop

func (v *Veth) Stop()

Stop stops the veth device

Jump to

Keyboard shortcuts

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