utils

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(s []string, e string) bool

Contains func is Check if node and link already exists

func CreateCfgFile

func CreateCfgFile(filename string) string

CreateCfgFile func is Create Template config yaml file

func GetIP

func GetIP() ([]string, error)

GetIP func is get ipv4 address

func ParsePid

func ParsePid(path string) (int, error)

ParsePid func is Parse Docker pid

Types

type Cmd

type Cmd struct {
	Cmd string `yaml:"cmd"`
}

Cmd struct is command

type Config

type Config struct {
	Config []Nodeconfig `yaml:"node_config"`
}

Config struct is many NodeConfigs

type Interface

type Interface struct {
	InfName  string `yaml:"inf"`
	Type     string `yaml:"type"`
	Ipv4     string `yaml:"ipv4"`
	Ipv6     string `yaml:"ipv6"`
	PeerNode string `yaml:"peernode"`
	PeerInf  string `yaml:"peerinf"`
}

Interface struct is Interface Config

type Microns

type Microns struct {
	Nodes       []Node       `yaml:"nodes"`
	Switches    []Switch     `yaml:"switches"`
	NodeConfigs []Nodeconfig `yaml:"node_config"`
	Test        []TestCmd    `yaml:"test"`
}

Microns struct is Microns config struct

type Node

type Node struct {
	Name      string      `yaml:"name"`
	Image     string      `yaml:"image"`
	Interface []Interface `yaml:"interfaces"`
	Volumes   []Volume    `yaml:"volumes"`
	Sysctls   []Sysctl    `yaml:"sysctls"`
}

Node struct is Node config

func ParseNodes

func ParseNodes(filepath string) []Node

ParseNodes func is parse nodes from microns config yaml file

type Nodeconfig

type Nodeconfig struct {
	Name string `yaml:"name"`
	Cmds []Cmd  `yaml:"cmds"`
}

Nodeconfig struct is Set NodeName and config Command

func ParseConfig

func ParseConfig(filepath string) []Nodeconfig

ParseConfig func is parse node config from microns config yaml file

type Nodes

type Nodes struct {
	Nodes []Node `yaml:"nodes"`
}

Nodes struct is Microns Nodes

type Switch

type Switch struct {
	Name       string      `yaml:"name"`
	Interfaces []Interface `yaml:"interfaces"`
}

Switch struct is BridgeName and Interface settings

func ParseSwitch

func ParseSwitch(filepath string) []Switch

ParseSwitch func is parse switches from microns config yaml file

type Switches

type Switches struct {
	Switches []Switch `yaml:"switches"`
}

Switches struct is Bridge Settings

type Sysctl

type Sysctl struct {
	Sysctl string `yaml:"sysctl"`
}

Sysctl struct is configure sysctl for docker container

type Test

type Test struct {
	Testcmds []TestCmd `yaml:"test"`
}

Test struct is many testcmds

type TestCmd

type TestCmd struct {
	Name string `yaml:"name"`
	Cmds []Cmd  `yaml:"cmds"`
}

TestCmd struct is Set NodeName and test command

func ParseTest

func ParseTest(filepath string) []TestCmd

ParseTest func is parse testcmds from microns config yaml file

type Tn

type Tn struct {
	Nodes []struct {
		Name       string `yaml:"name"`
		Image      string `yaml:"image"`
		Interfaces []struct {
			Name string `yaml:"name"`
			Type string `yaml:"type"`
			Args string `yaml:"args"`
		} `yaml:"interfaces"`
	} `yaml:"nodes"`
	Switches []struct {
		Name       string        `yaml:"name"`
		Interfaces []TnInterface `yaml:"interfaces"`
	} `yaml:"switches"`
	NodeConfigs []struct {
		Name string `yaml:"name"`
		Cmds []struct {
			Cmd string `yaml:"cmd"`
		} `yaml:"cmds"`
	} `yaml:"node_configs"`
	Test []struct {
		Name string `yaml:"name"`
		Cmds []struct {
			Cmd string `yaml:"cmd"`
		} `yaml:"cmds"`
	} `yaml:"test"`
}

Tn struct is Tinet Config

type TnInterface

type TnInterface struct {
	Name string `yaml:"name"`
	Type string `yaml:"type"`
	Args string `yaml:"args"`
}

TnInterface struct is Tinet Interface config struct

type Volume

type Volume struct {
	HostVolume      string `yaml:"hostvolume"`
	ContainerVolume string `yaml:"containervolume"`
}

Volume struct is Mount to Docker Settings

Jump to

Keyboard shortcuts

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