Documentation
¶
Overview ¶
Package shell generate shell script
Index ¶
- func DockerPs(all bool) (dockerPsCmd string)
- func ExecCmd(cmds []Cmd) (execCmds []string)
- func GenerateFile() (genContent string, err error)
- func GetContainerPid(nodename string) (getpidCmd string)
- func HostLinkUp(linkName string) (linkUpCmd string)
- func NetnsLinkUp(netnsName string, linkName string) (netnsLinkUpCmd string)
- func NetnsPs() (netnsListCmd string)
- func Pull(nodes []Node) (pullCmds []string)
- type Cmd
- type Interface
- func (inf *Interface) AddrSet(nodeName string) (addrSetCmd string)
- func (inf *Interface) N2nLink(nodeName string) (n2nLinkCmds []string)
- func (inf *Interface) P2cLink(nodeName string) (p2cLinkCmds []string)
- func (inf *Interface) S2nLink(nodeName string) (s2nLinkCmds []string)
- func (inf *Interface) V2cLink(nodeName string) (v2cLinkCmds []string)
- type Node
- func (node *Node) BuildCmd() (buildCmd string)
- func (node *Node) CreateNode() (createNodeCmds []string)
- func (node *Node) DelNsCmd() (delNsCmd string)
- func (node *Node) DeleteNode() (deleteNodeCmds []string)
- func (node *Node) MountTmpl() (mountTmplCmd []string, err error)
- func (node *Node) Mount_docker_netns() (mountDockerNetnsCmds []string)
- type NodeConfig
- type PostFini
- type PostInit
- type PreCmd
- type PreInit
- type Switch
- type Sysctl
- type Template
- type Test
- type Tn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateFile ¶
GenerateFile Generate tinet template config file
func GetContainerPid ¶
GetContainerPid func is Output get Docker PID Command
func HostLinkUp ¶
HostLinkUp Link up link of host
func NetnsLinkUp ¶
NetnsLinkUp Link up link of netns
Types ¶
type Interface ¶
type Interface struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Args string `yaml:"args"`
Addr string `yaml:"addr"`
Label string `yaml:"label"`
}
Interface
type Node ¶
type Node struct {
Name string `yaml:"name" mapstructure:"name"`
Type string `yaml:"type" mapstructure:"type"`
NetBase string `yaml:"net_base" mapstructure:"net_base"`
VolumeBase string `yaml:"volume" mapstructure:"volume"`
Image string `yaml:"image" mapstructure:"image"`
BuildFile string `yaml:"buildfile" mapstructure:"buildfile"`
BuildContext string `yaml:"buildcontext" mapstructure:"buildcontext"`
Interfaces []Interface `yaml:"interfaces" mapstructure:"interfaces"`
Sysctls []Sysctl `yaml:"sysctls" mapstructure:"sysctls"`
Mounts []string `yaml:"mounts,flow" mapstructure:"mounts,flow"`
DNS []string `yaml:"dns,flow" mapstructure:"dns,flow"`
DNSSearches []string `yaml:"dns_search,flow" mapstructure:"dns_search,flow"`
HostNameIgnore bool `yaml:"hostname_ignore" mapstructure:"hostname_ignore"`
EntryPoint string `yaml:"entrypoint" mapstructure:"entrypoint"`
ExtraArgs string `yaml:"docker_run_extra_args" mapstructure:"docker_run_extra_args"`
Vars map[string]interface{} `yaml:"vars" mapstructure:"vars"`
Templates []Template `yaml:"templates" mapstructure:"templates"`
}
Node
func (*Node) CreateNode ¶
CreateNode Create nodes set in config
func (*Node) DeleteNode ¶
DeleteNode Delete docker and netns
func (*Node) Mount_docker_netns ¶
Mount_docker_netns Mount docker netns to ip netns
type NodeConfig ¶
NodeConfig
func (*NodeConfig) ExecConf ¶
func (nodeConfig *NodeConfig) ExecConf(nodeType string) (execConfCmds []string)
ExecConf Execute NodeConfig command
type PreCmd ¶
type PreCmd struct {
// Cmds []Cmd `yaml:"cmds"`
Cmds []Cmd `yaml:"cmds" mapstructure:"cmds"`
}
PreCmd
type Switch ¶
type Switch struct {
Name string `yaml:"name"`
Interfaces []Interface `yaml:"interfaces" mapstructure:"interfaces"`
}
Switch
func (*Switch) CreateSwitch ¶
CreateSwitch Create bridge set in config
func (*Switch) DeleteSwitch ¶
DeleteSwitch Delete bridge
type Tn ¶
type Tn struct {
PreCmd []PreCmd `yaml:"precmd"`
PreInit []PreInit `yaml:"preinit"`
PostInit []PostInit `yaml:"postinit"`
PostFini []PostFini `yaml:"postfini"`
Nodes []Node `yaml:"nodes" mapstructure:"nodes"`
Switches []Switch `yaml:"switches" mapstructure:"switches"`
NodeConfigs []NodeConfig `yaml:"node_configs" mapstructure:"node_configs"`
Test []Test `yaml:"test"`
}
Tn tinet config
Click to show internal directories.
Click to hide internal directories.