Documentation ¶
Index ¶
- func NewServer() *netemServer
- func ProjectClose(prjId string, progressCh chan TopologyRunCloseProgressT) error
- func ProjectGetMany() map[string]*NetemProject
- func ProjectGetNodeConfigs(prjId string) (*bytes.Buffer, error)
- func ProjectIsExist(prjName string) bool
- func ProjectIsIdExist(prjID string) bool
- func ProjectSave(prjId string, progressCh chan TopologySaveProgressT) (*bytes.Buffer, error)
- type BridgeConfig
- type CloseProgressCode
- type INetemNode
- type LinkConfig
- type NetemBridge
- type NetemLink
- type NetemLinkPeer
- type NetemNode
- type NetemProject
- type NetemTopology
- type NetemTopologyManager
- func (t *NetemTopologyManager) Check() error
- func (t *NetemTopologyManager) Close(progressCh chan TopologyRunCloseProgressT) error
- func (t *NetemTopologyManager) GetAllNodes() []INetemNode
- func (t *NetemTopologyManager) GetLink(peer1V string, peer2V string) (*NetemLink, int, error)
- func (t *NetemTopologyManager) GetNetFilePath() string
- func (t *NetemTopologyManager) GetNode(name string) INetemNode
- func (t *NetemTopologyManager) IsNodeLaunchAtStartup(name string) bool
- func (t *NetemTopologyManager) IsRunning() bool
- func (t *NetemTopologyManager) LinkAdd(linkCfg LinkConfig, sync bool) error
- func (t *NetemTopologyManager) LinkDel(linkCfg LinkConfig, sync bool) error
- func (t *NetemTopologyManager) LinkUpdate(linkCfg LinkConfig, sync bool) error
- func (t *NetemTopologyManager) Load() error
- func (t *NetemTopologyManager) ReadConfigFiles(nodeName string) (map[string][]byte, error)
- func (t *NetemTopologyManager) ReadNetworkFile() ([]byte, error)
- func (t *NetemTopologyManager) Reload(progressCh chan TopologyRunCloseProgressT) ([]*proto.TopologyRunMsg_NodeMessages, error)
- func (t *NetemTopologyManager) Run(progressCh chan TopologyRunCloseProgressT) ([]*proto.TopologyRunMsg_NodeMessages, error)
- func (t *NetemTopologyManager) Save(progressCh chan TopologySaveProgressT) error
- func (t *NetemTopologyManager) Start(nodeName string) ([]string, error)
- func (t *NetemTopologyManager) Stop(nodeName string) error
- func (t *NetemTopologyManager) SynchroniseTopology() error
- func (t *NetemTopologyManager) WriteNetworkFile(data []byte) error
- type NodeConfig
- type NodeIdentifierGenerator
- type NodeNotFoundError
- type ProjectNotFoundError
- type RunCloseProgressCode
- type SaveProgressCode
- type TopologyRunCloseProgressT
- type TopologySaveProgressT
- type VrrpOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProjectClose ¶ added in v0.3.0
func ProjectClose(prjId string, progressCh chan TopologyRunCloseProgressT) error
func ProjectGetMany ¶ added in v0.3.0
func ProjectGetMany() map[string]*NetemProject
func ProjectGetNodeConfigs ¶ added in v0.3.0
func ProjectIsExist ¶ added in v0.3.0
func ProjectIsIdExist ¶ added in v0.3.0
func ProjectSave ¶ added in v0.3.0
func ProjectSave(prjId string, progressCh chan TopologySaveProgressT) (*bytes.Buffer, error)
Types ¶
type BridgeConfig ¶
type CloseProgressCode ¶ added in v0.3.0
type CloseProgressCode int
type INetemNode ¶
type INetemNode interface { GetName() string GetShortName() string GetType() string GetFullType() string IsRunning() bool Start() error Stop() error GetNetns() (netns.NsHandle, error) GetInterfaceName(ifIndex int) string AddInterface(ifName string, ifIndex int, ns netns.NsHandle) error LoadConfig(confPath string, timeout int) ([]string, error) ExecCommand(cmd []string, in io.ReadCloser, out io.Writer, tty bool, ttyHeight uint, ttyWidth uint, resizeCh chan term.Winsize) error GetConsoleCmd(shell bool) ([]string, error) Capture(ifIndex int, out io.Writer) error CopyFrom(srcPath, destPath string) error CopyTo(srcPath, destPath string) error ReadConfigFiles(confDir string, timeout int) (map[string][]byte, error) Save(dstPath string, timeout int) error GetInterfacesState() map[string]link.IfState SetInterfaceState(ifIndex int, state link.IfState) error Close() error }
func CreateNode ¶
func CreateNode(prjID string, name string, shortName string, config NodeConfig) (INetemNode, error)
type LinkConfig ¶
type NetemBridge ¶
type NetemBridge struct { Name string HostInterface string Peers []NetemLinkPeer Config BridgeConfig }
type NetemLink ¶
type NetemLink struct { Peer1 NetemLinkPeer Peer2 NetemLinkPeer Config LinkConfig HasNetem bool HasTbf bool }
type NetemLinkPeer ¶
type NetemLinkPeer struct { Node INetemNode IfIndex int }
type NetemNode ¶ added in v0.3.0
type NetemNode struct { Instance INetemNode LaunchAtStartup bool Config NodeConfig }
type NetemProject ¶
type NetemProject struct { Id string Name string Dir string OpenAt time.Time Topology *NetemTopologyManager }
func ProjectGetOne ¶ added in v0.3.0
func ProjectGetOne(prjID string) *NetemProject
func ProjectOpen ¶ added in v0.3.0
func ProjectOpen(prjId, name string, data []byte) (*NetemProject, error)
type NetemTopology ¶
type NetemTopology struct { Nodes map[string]NodeConfig `yaml:",omitempty"` Links []LinkConfig `yaml:",omitempty"` Bridges map[string]BridgeConfig `yaml:",omitempty"` }
func CheckTopology ¶
func CheckTopology(filepath string) (*NetemTopology, []error)
type NetemTopologyManager ¶
type NetemTopologyManager struct { IdGenerator *NodeIdentifierGenerator // contains filtered or unexported fields }
func LoadTopology ¶
func LoadTopology(prjID, prjPath string) (*NetemTopologyManager, error)
func (*NetemTopologyManager) Check ¶
func (t *NetemTopologyManager) Check() error
func (*NetemTopologyManager) Close ¶
func (t *NetemTopologyManager) Close(progressCh chan TopologyRunCloseProgressT) error
func (*NetemTopologyManager) GetAllNodes ¶
func (t *NetemTopologyManager) GetAllNodes() []INetemNode
func (*NetemTopologyManager) GetNetFilePath ¶
func (t *NetemTopologyManager) GetNetFilePath() string
func (*NetemTopologyManager) GetNode ¶
func (t *NetemTopologyManager) GetNode(name string) INetemNode
func (*NetemTopologyManager) IsNodeLaunchAtStartup ¶ added in v0.3.0
func (t *NetemTopologyManager) IsNodeLaunchAtStartup(name string) bool
func (*NetemTopologyManager) IsRunning ¶
func (t *NetemTopologyManager) IsRunning() bool
func (*NetemTopologyManager) LinkAdd ¶ added in v0.4.0
func (t *NetemTopologyManager) LinkAdd(linkCfg LinkConfig, sync bool) error
func (*NetemTopologyManager) LinkDel ¶ added in v0.4.0
func (t *NetemTopologyManager) LinkDel(linkCfg LinkConfig, sync bool) error
func (*NetemTopologyManager) LinkUpdate ¶ added in v0.3.0
func (t *NetemTopologyManager) LinkUpdate(linkCfg LinkConfig, sync bool) error
func (*NetemTopologyManager) Load ¶
func (t *NetemTopologyManager) Load() error
func (*NetemTopologyManager) ReadConfigFiles ¶ added in v0.2.0
func (t *NetemTopologyManager) ReadConfigFiles(nodeName string) (map[string][]byte, error)
func (*NetemTopologyManager) ReadNetworkFile ¶
func (t *NetemTopologyManager) ReadNetworkFile() ([]byte, error)
func (*NetemTopologyManager) Reload ¶
func (t *NetemTopologyManager) Reload(progressCh chan TopologyRunCloseProgressT) ([]*proto.TopologyRunMsg_NodeMessages, error)
func (*NetemTopologyManager) Run ¶
func (t *NetemTopologyManager) Run(progressCh chan TopologyRunCloseProgressT) ([]*proto.TopologyRunMsg_NodeMessages, error)
func (*NetemTopologyManager) Save ¶
func (t *NetemTopologyManager) Save(progressCh chan TopologySaveProgressT) error
func (*NetemTopologyManager) Start ¶
func (t *NetemTopologyManager) Start(nodeName string) ([]string, error)
func (*NetemTopologyManager) Stop ¶
func (t *NetemTopologyManager) Stop(nodeName string) error
func (*NetemTopologyManager) SynchroniseTopology ¶ added in v0.4.0
func (t *NetemTopologyManager) SynchroniseTopology() error
func (*NetemTopologyManager) WriteNetworkFile ¶
func (t *NetemTopologyManager) WriteNetworkFile(data []byte) error
type NodeConfig ¶
type NodeConfig struct { Type string IPv6 bool `yaml:",omitempty" default:"false"` Mpls bool `yaml:",omitempty" default:"false"` Vrfs []string `yaml:",omitempty"` Vrrps []VrrpOptions `yaml:",omitempty"` Volumes []string `yaml:",omitempty"` Image string `yaml:",omitempty"` Launch bool `default:"true"` }
func (*NodeConfig) UnmarshalYAML ¶ added in v0.3.0
func (n *NodeConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
type NodeIdentifierGenerator ¶ added in v0.1.1
type NodeIdentifierGenerator struct {
// contains filtered or unexported fields
}
func (*NodeIdentifierGenerator) Close ¶ added in v0.1.1
func (nIdGen *NodeIdentifierGenerator) Close()
type NodeNotFoundError ¶
type NodeNotFoundError struct {
// contains filtered or unexported fields
}
func (*NodeNotFoundError) Error ¶
func (e *NodeNotFoundError) Error() string
type ProjectNotFoundError ¶
type ProjectNotFoundError struct {
Id string
}
func (*ProjectNotFoundError) Error ¶
func (e *ProjectNotFoundError) Error() string
type RunCloseProgressCode ¶ added in v0.3.0
type RunCloseProgressCode int
const ( NODE_COUNT RunCloseProgressCode = 1 BRIDGE_COUNT RunCloseProgressCode = 2 LINK_COUNT RunCloseProgressCode = 3 LOAD_TOPO RunCloseProgressCode = 4 START_NODE RunCloseProgressCode = 5 SETUP_LINK RunCloseProgressCode = 6 START_BRIDGE RunCloseProgressCode = 7 LOADCONFIG_NODE RunCloseProgressCode = 8 CLOSE_NODE RunCloseProgressCode = 9 CLOSE_BRIDGE RunCloseProgressCode = 10 )
type SaveProgressCode ¶ added in v0.3.0
type SaveProgressCode int
const ( NODE_SAVE_COUNT SaveProgressCode = 1 NODE_SAVE SaveProgressCode = 2 )
type TopologyRunCloseProgressT ¶ added in v0.3.0
type TopologyRunCloseProgressT struct { Code RunCloseProgressCode Value int }
type TopologySaveProgressT ¶ added in v0.3.0
type TopologySaveProgressT struct { Code SaveProgressCode Value int }
type VrrpOptions ¶ added in v0.1.1
Click to show internal directories.
Click to hide internal directories.