api

package
v0.0.0-...-646168a Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(s string) bool

Confirm func is Wait until yes or no is entered

func Convert

func Convert(tncfg, mncfg string) error

Convert tinet config to microns config

func HtmlHandler

func HtmlHandler(w http.ResponseWriter, r *http.Request)

HtmlHandler func is template html view

func JsonResHandler

func JsonResHandler(filepath string)

JsonResHandler func is d3 force layout json response adn create frontend server

func LinkUp

func LinkUp(linkname string) error

LinkUp is Link up to interface

func RemoveBr

func RemoveBr(bridgeName string) error

RemoveBr is Remove Linux Bridge

func SetBridge

func SetBridge(node utils.Node, inf utils.Interface) error

SetBridge is Create Linux Bridge, and Link Bridge and Veth, and Set ip address to interface

func SetLink(node utils.Node, inf utils.Interface) error

SetLink is Link Node interface and Other Node interface, and Set ip address to interface

Types

type Component

type Component struct {
	Ns        string `json:"ns"`
	Container string `json:"container"`
}

Component for microns status

type Container

type Container struct {
	Ctx context.Context
	Cli *client.Client
}

Container Operation struct

func NewContainer

func NewContainer(ctx context.Context, cli *client.Client) *Container

NewContainer func is Create Container Client

func (*Container) CreateContainerPort

func (c *Container) CreateContainerPort(imageName string, hostName string, cport string, hport string, cfgfile string) error

CreateContainerPort func is container create port binding

func (*Container) Dockertonetns

func (c *Container) Dockertonetns(nodename string) error

Dockertonetns is Mount Docker network namespace tp network namespace

func (*Container) Pull

func (c *Container) Pull(nodes []utils.Node) error

Pull and Create Docker Container from config and Set Option for sysctl and volume

func (*Container) RemoveContainer

func (c *Container) RemoveContainer(nodename string) error

RemoveContainer is Remove Docker Container

func (*Container) RemoveNs

func (c *Container) RemoveNs(nodename string) error

RemoveNs is Remove Docker Container, and Remove Network Namespace

func (*Container) SetConf

func (c *Container) SetConf(containerName string, cmd string) error

SetConf is Set config from config

func (*Container) StartContainer

func (c *Container) StartContainer(nodename string) error

StartContainer is start docker container

func (*Container) StatusNs

func (c *Container) StatusNs(nodename string) (string, error)

StatusNs is Status of containers and ns made with microns

func (*Container) StopContainer

func (c *Container) StopContainer(nodename string) error

StopContainer is stop docker container

type D3Link struct {
	Source int `json:"source"`
	Target int `json:"target"`
}

D3Link struct is d3 node link

type D3Node

type D3Node struct {
	Id    int    `json:"id"`
	Label string `json:"label"`
	Types string `json:"types"`
}

D3Node struct is d3 node

type D3json

type D3json struct {
	D3Nodes []D3Node `json:"nodes"`
	D3Links []D3Link `json:"links"`
}

D3json d3node and d3link

type Status

type Status struct {
	Name   string    `json:"name"`
	Status Component `json:"status"`
}

Status struct is Container and Netns status

Jump to

Keyboard shortcuts

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