Documentation ¶
Index ¶
- type IfNetlinkHandlerMock
- func (mock *IfNetlinkHandlerMock) AddInterfaceIP(ifName string, addr *net.IPNet) error
- func (mock *IfNetlinkHandlerMock) AddVethInterfacePair(ifName, peerIfName string) error
- func (mock *IfNetlinkHandlerMock) DelInterfaceIP(ifName string, addr *net.IPNet) error
- func (mock *IfNetlinkHandlerMock) DelVethInterfacePair(ifName, peerIfName string) error
- func (mock *IfNetlinkHandlerMock) GetAddressList(ifName string) ([]netlink.Addr, error)
- func (mock *IfNetlinkHandlerMock) GetInterfaceByName(ifName string) (*net.Interface, error)
- func (mock *IfNetlinkHandlerMock) GetInterfaceType(ifName string) (string, error)
- func (mock *IfNetlinkHandlerMock) GetLinkByName(ifName string) (netlink.Link, error)
- func (mock *IfNetlinkHandlerMock) GetLinkList() ([]netlink.Link, error)
- func (mock *IfNetlinkHandlerMock) GetVethPeerName(ifName string) (string, error)
- func (mock *IfNetlinkHandlerMock) InterfaceExists(ifName string) (bool, error)
- func (mock *IfNetlinkHandlerMock) RenameInterface(ifName string, newName string) error
- func (mock *IfNetlinkHandlerMock) SetInterfaceDown(ifName string) error
- func (mock *IfNetlinkHandlerMock) SetInterfaceMTU(ifName string, mtu int) error
- func (mock *IfNetlinkHandlerMock) SetInterfaceMac(ifName string, macAddress string) error
- func (mock *IfNetlinkHandlerMock) SetInterfaceUp(ifName string) error
- func (mock *IfNetlinkHandlerMock) SetStopwatch(stopwatch *measure.Stopwatch)
- func (mock *IfNetlinkHandlerMock) When(name string) *whenIfResp
- type L3NetlinkHandlerMock
- func (mock *L3NetlinkHandlerMock) AddArpEntry(name string, arpEntry *netlink.Neigh) error
- func (mock *L3NetlinkHandlerMock) AddStaticRoute(name string, route *netlink.Route) error
- func (mock *L3NetlinkHandlerMock) DelArpEntry(name string, arpEntry *netlink.Neigh) error
- func (mock *L3NetlinkHandlerMock) DelStaticRoute(name string, route *netlink.Route) error
- func (mock *L3NetlinkHandlerMock) GetArpEntries(interfaceIdx int, family int) ([]netlink.Neigh, error)
- func (mock *L3NetlinkHandlerMock) ReplaceStaticRoute(name string, route *netlink.Route) error
- func (mock *L3NetlinkHandlerMock) SetArpEntry(name string, arpEntry *netlink.Neigh) error
- func (mock *L3NetlinkHandlerMock) SetStopwatch(stopwatch *measure.Stopwatch)
- func (mock *L3NetlinkHandlerMock) When(name string) *whenL3Resp
- type NamespacePluginMock
- func (mock *NamespacePluginMock) ArpNsToGeneric(ns *l3.LinuxStaticArpEntries_ArpEntry_Namespace) *nsplugin.Namespace
- func (mock *NamespacePluginMock) GenericToArpNs(ns *nsplugin.Namespace) (*l3.LinuxStaticArpEntries_ArpEntry_Namespace, error)
- func (mock *NamespacePluginMock) GetConfigNamespace() *interfaces.LinuxInterfaces_Interface_Namespace
- func (mock *NamespacePluginMock) HandleMicroservices(ctx *nsplugin.MicroserviceCtx)
- func (mock *NamespacePluginMock) IfNsToGeneric(ns *interfaces.LinuxInterfaces_Interface_Namespace) *nsplugin.Namespace
- func (mock *NamespacePluginMock) IfaceNsToString(namespace *interfaces.LinuxInterfaces_Interface_Namespace) string
- func (mock *NamespacePluginMock) IsNamespaceAvailable(ns *interfaces.LinuxInterfaces_Interface_Namespace) bool
- func (mock *NamespacePluginMock) RouteNsToGeneric(ns *l3.LinuxStaticRoutes_Route_Namespace) *nsplugin.Namespace
- func (mock *NamespacePluginMock) SetInterfaceNamespace(ctx *nsplugin.NamespaceMgmtCtx, ifName string, ...) error
- func (mock *NamespacePluginMock) SwitchNamespace(ns *nsplugin.Namespace, ctx *nsplugin.NamespaceMgmtCtx) (func(), error)
- func (mock *NamespacePluginMock) SwitchToNamespace(nsMgmtCtx *nsplugin.NamespaceMgmtCtx, ...) (func(), error)
- func (mock *NamespacePluginMock) When(methodName string) *whenNsResp
- type SystemMock
- func (mock *SystemMock) GetNamespaceFromName(name string) (netns.NsHandle, error)
- func (mock *SystemMock) MkDirAll(path string, perm os.FileMode) error
- func (mock *SystemMock) Mount(source string, target string, fsType string, flags uintptr, data string) error
- func (mock *SystemMock) NewNetworkNamespace() (netns.NsHandle, error)
- func (mock *SystemMock) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
- func (mock *SystemMock) Remove(name string) error
- func (mock *SystemMock) SetNamespace(ns netns.NsHandle) error
- func (mock *SystemMock) Unmount(target string, flags int) error
- func (mock *SystemMock) When(name string) *whenStResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IfNetlinkHandlerMock ¶
type IfNetlinkHandlerMock struct {
// contains filtered or unexported fields
}
NetlinkHandlerMock allows to mock netlink-related methods
func NewIfNetlinkHandlerMock ¶
func NewIfNetlinkHandlerMock() *IfNetlinkHandlerMock
NewNetlinkHandlerMock creates new instance of the mock and initializes response list
func (*IfNetlinkHandlerMock) AddInterfaceIP ¶
func (mock *IfNetlinkHandlerMock) AddInterfaceIP(ifName string, addr *net.IPNet) error
func (*IfNetlinkHandlerMock) AddVethInterfacePair ¶
func (mock *IfNetlinkHandlerMock) AddVethInterfacePair(ifName, peerIfName string) error
func (*IfNetlinkHandlerMock) DelInterfaceIP ¶
func (mock *IfNetlinkHandlerMock) DelInterfaceIP(ifName string, addr *net.IPNet) error
func (*IfNetlinkHandlerMock) DelVethInterfacePair ¶
func (mock *IfNetlinkHandlerMock) DelVethInterfacePair(ifName, peerIfName string) error
func (*IfNetlinkHandlerMock) GetAddressList ¶
func (mock *IfNetlinkHandlerMock) GetAddressList(ifName string) ([]netlink.Addr, error)
func (*IfNetlinkHandlerMock) GetInterfaceByName ¶
func (mock *IfNetlinkHandlerMock) GetInterfaceByName(ifName string) (*net.Interface, error)
func (*IfNetlinkHandlerMock) GetInterfaceType ¶
func (mock *IfNetlinkHandlerMock) GetInterfaceType(ifName string) (string, error)
func (*IfNetlinkHandlerMock) GetLinkByName ¶
func (mock *IfNetlinkHandlerMock) GetLinkByName(ifName string) (netlink.Link, error)
func (*IfNetlinkHandlerMock) GetLinkList ¶
func (mock *IfNetlinkHandlerMock) GetLinkList() ([]netlink.Link, error)
func (*IfNetlinkHandlerMock) GetVethPeerName ¶
func (mock *IfNetlinkHandlerMock) GetVethPeerName(ifName string) (string, error)
func (*IfNetlinkHandlerMock) InterfaceExists ¶
func (mock *IfNetlinkHandlerMock) InterfaceExists(ifName string) (bool, error)
func (*IfNetlinkHandlerMock) RenameInterface ¶
func (mock *IfNetlinkHandlerMock) RenameInterface(ifName string, newName string) error
func (*IfNetlinkHandlerMock) SetInterfaceDown ¶
func (mock *IfNetlinkHandlerMock) SetInterfaceDown(ifName string) error
func (*IfNetlinkHandlerMock) SetInterfaceMTU ¶
func (mock *IfNetlinkHandlerMock) SetInterfaceMTU(ifName string, mtu int) error
func (*IfNetlinkHandlerMock) SetInterfaceMac ¶
func (mock *IfNetlinkHandlerMock) SetInterfaceMac(ifName string, macAddress string) error
func (*IfNetlinkHandlerMock) SetInterfaceUp ¶
func (mock *IfNetlinkHandlerMock) SetInterfaceUp(ifName string) error
func (*IfNetlinkHandlerMock) SetStopwatch ¶
func (mock *IfNetlinkHandlerMock) SetStopwatch(stopwatch *measure.Stopwatch)
func (*IfNetlinkHandlerMock) When ¶
func (mock *IfNetlinkHandlerMock) When(name string) *whenIfResp
When defines name of the related method. It creates a new instance of whenIfResp with provided method name and stores it to the mock.
type L3NetlinkHandlerMock ¶
type L3NetlinkHandlerMock struct {
// contains filtered or unexported fields
}
NetlinkHandlerMock allows to mock netlink-related methods
func NewL3NetlinkHandlerMock ¶
func NewL3NetlinkHandlerMock() *L3NetlinkHandlerMock
NewNetlinkHandlerMock creates new instance of the mock and initializes response list
func (*L3NetlinkHandlerMock) AddArpEntry ¶
func (mock *L3NetlinkHandlerMock) AddArpEntry(name string, arpEntry *netlink.Neigh) error
func (*L3NetlinkHandlerMock) AddStaticRoute ¶
func (mock *L3NetlinkHandlerMock) AddStaticRoute(name string, route *netlink.Route) error
func (*L3NetlinkHandlerMock) DelArpEntry ¶
func (mock *L3NetlinkHandlerMock) DelArpEntry(name string, arpEntry *netlink.Neigh) error
func (*L3NetlinkHandlerMock) DelStaticRoute ¶
func (mock *L3NetlinkHandlerMock) DelStaticRoute(name string, route *netlink.Route) error
func (*L3NetlinkHandlerMock) GetArpEntries ¶
func (*L3NetlinkHandlerMock) ReplaceStaticRoute ¶
func (mock *L3NetlinkHandlerMock) ReplaceStaticRoute(name string, route *netlink.Route) error
func (*L3NetlinkHandlerMock) SetArpEntry ¶
func (mock *L3NetlinkHandlerMock) SetArpEntry(name string, arpEntry *netlink.Neigh) error
func (*L3NetlinkHandlerMock) SetStopwatch ¶
func (mock *L3NetlinkHandlerMock) SetStopwatch(stopwatch *measure.Stopwatch)
func (*L3NetlinkHandlerMock) When ¶
func (mock *L3NetlinkHandlerMock) When(name string) *whenL3Resp
When defines name of the related method. It creates a new instance of whenL3Resp with provided method name and stores it to the mock.
type NamespacePluginMock ¶
type NamespacePluginMock struct {
// contains filtered or unexported fields
}
NamespacePluginMock allows to mock namespace plugin methods to manage namespaces and microservices
func NewNamespacePluginMock ¶
func NewNamespacePluginMock() *NamespacePluginMock
NewNamespacePluginMock creates new instance of the mock and initializes response list
func (*NamespacePluginMock) ArpNsToGeneric ¶
func (mock *NamespacePluginMock) ArpNsToGeneric(ns *l3.LinuxStaticArpEntries_ArpEntry_Namespace) *nsplugin.Namespace
func (*NamespacePluginMock) GenericToArpNs ¶
func (mock *NamespacePluginMock) GenericToArpNs(ns *nsplugin.Namespace) (*l3.LinuxStaticArpEntries_ArpEntry_Namespace, error)
func (*NamespacePluginMock) GetConfigNamespace ¶
func (mock *NamespacePluginMock) GetConfigNamespace() *interfaces.LinuxInterfaces_Interface_Namespace
func (*NamespacePluginMock) HandleMicroservices ¶
func (mock *NamespacePluginMock) HandleMicroservices(ctx *nsplugin.MicroserviceCtx)
func (*NamespacePluginMock) IfNsToGeneric ¶
func (mock *NamespacePluginMock) IfNsToGeneric(ns *interfaces.LinuxInterfaces_Interface_Namespace) *nsplugin.Namespace
func (*NamespacePluginMock) IfaceNsToString ¶
func (mock *NamespacePluginMock) IfaceNsToString(namespace *interfaces.LinuxInterfaces_Interface_Namespace) string
func (*NamespacePluginMock) IsNamespaceAvailable ¶
func (mock *NamespacePluginMock) IsNamespaceAvailable(ns *interfaces.LinuxInterfaces_Interface_Namespace) bool
func (*NamespacePluginMock) RouteNsToGeneric ¶
func (mock *NamespacePluginMock) RouteNsToGeneric(ns *l3.LinuxStaticRoutes_Route_Namespace) *nsplugin.Namespace
func (*NamespacePluginMock) SetInterfaceNamespace ¶
func (mock *NamespacePluginMock) SetInterfaceNamespace(ctx *nsplugin.NamespaceMgmtCtx, ifName string, namespace *interfaces.LinuxInterfaces_Interface_Namespace) error
func (*NamespacePluginMock) SwitchNamespace ¶
func (mock *NamespacePluginMock) SwitchNamespace(ns *nsplugin.Namespace, ctx *nsplugin.NamespaceMgmtCtx) (func(), error)
func (*NamespacePluginMock) SwitchToNamespace ¶
func (mock *NamespacePluginMock) SwitchToNamespace(nsMgmtCtx *nsplugin.NamespaceMgmtCtx, ns *interfaces.LinuxInterfaces_Interface_Namespace) (func(), error)
func (*NamespacePluginMock) When ¶
func (mock *NamespacePluginMock) When(methodName string) *whenNsResp
When defines name of the related method. It creates a new instance of whenNsResp with provided method name and stores it to the mock.
type SystemMock ¶
type SystemMock struct {
// contains filtered or unexported fields
}
SystemMock allows to mock netlink-related methods
func NewSystemMock ¶
func NewSystemMock() *SystemMock
NewSystemMock creates new instance of the mock and initializes response list
func (*SystemMock) GetNamespaceFromName ¶
func (mock *SystemMock) GetNamespaceFromName(name string) (netns.NsHandle, error)
func (*SystemMock) NewNetworkNamespace ¶
func (mock *SystemMock) NewNetworkNamespace() (netns.NsHandle, error)
func (*SystemMock) Remove ¶
func (mock *SystemMock) Remove(name string) error
func (*SystemMock) SetNamespace ¶
func (mock *SystemMock) SetNamespace(ns netns.NsHandle) error
func (*SystemMock) When ¶
func (mock *SystemMock) When(name string) *whenStResp
When defines name of the related method. It creates a new instance of whenStResp with provided method name and stores it to the mock.