Documentation ¶
Overview ¶
Package fake is a fake datapath implementation. It does not implement any datapath specific concepts and is useful for mocking and testing.
Index ¶
- Variables
- func NewIPv4OnlyNodeAddressing() types.NodeAddressing
- func NewIPv6OnlyNodeAddressing() types.NodeAddressing
- func NewNodeAddressing() types.NodeAddressing
- type FakeDatapath
- func (f *FakeDatapath) FakeNode() *FakeNodeHandler
- func (m *FakeDatapath) GetProxyPort(name string) uint16
- func (m *FakeDatapath) InstallNoTrackRules(IP string, port uint16, ipv6 bool) error
- func (f *FakeDatapath) InstallProxyRules(context.Context, uint16, bool, string) error
- func (f *FakeDatapath) InstallRules(ctx context.Context, ifName string, quiet, install bool) error
- func (f *FakeDatapath) LBMap() types.LBMap
- func (f *FakeDatapath) LBMockMap() *mockmaps.LBMockMap
- func (f *FakeDatapath) Loader() datapath.Loader
- func (f *FakeDatapath) LocalNodeAddressing() types.NodeAddressing
- func (f *FakeDatapath) Node() datapath.NodeHandler
- func (f *FakeDatapath) Procfs() string
- func (m *FakeDatapath) RemoveNoTrackRules(IP string, port uint16, ipv6 bool) error
- func (f *FakeDatapath) SupportsOriginalSourceAddr() bool
- func (f *FakeDatapath) WireguardAgent() datapath.WireguardAgent
- func (f *FakeDatapath) WriteEndpointConfig(io.Writer, datapath.EndpointConfiguration) error
- func (f *FakeDatapath) WriteNetdevConfig(io.Writer, datapath.DeviceConfiguration) error
- func (f *FakeDatapath) WriteNodeConfig(io.Writer, *datapath.LocalNodeConfiguration) error
- func (f *FakeDatapath) WriteTemplateConfig(io.Writer, datapath.EndpointConfiguration) error
- type FakeNodeHandler
- func (n *FakeNodeHandler) AllocateNodeID(_ net.IP) uint16
- func (n *FakeNodeHandler) DumpNodeIDs() []*models.NodeID
- func (n *FakeNodeHandler) NodeAdd(newNode nodeTypes.Node) error
- func (n *FakeNodeHandler) NodeCleanNeighbors(migrateOnly bool)
- func (n *FakeNodeHandler) NodeConfigurationChanged(config datapath.LocalNodeConfiguration) error
- func (n *FakeNodeHandler) NodeDelete(node nodeTypes.Node) error
- func (n *FakeNodeHandler) NodeNeighDiscoveryEnabled() bool
- func (n *FakeNodeHandler) NodeNeighborRefresh(ctx context.Context, node nodeTypes.Node)
- func (n *FakeNodeHandler) NodeUpdate(oldNode, newNode nodeTypes.Node) error
- func (n *FakeNodeHandler) NodeValidateImplementation(node nodeTypes.Node) error
- func (n *FakeNodeHandler) RestoreNodeIDs()
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewIPv4OnlyNodeAddressing ¶
func NewIPv4OnlyNodeAddressing() types.NodeAddressing
NewIPv4OnlyNodeAddressing returns a new fake node addressing where IPv6 is disabled
func NewIPv6OnlyNodeAddressing ¶
func NewIPv6OnlyNodeAddressing() types.NodeAddressing
NewIPv6OnlyNodeAddressing returns a new fake node addressing where IPv4 is disabled
func NewNodeAddressing ¶
func NewNodeAddressing() types.NodeAddressing
NewNodeAddressing returns a new fake node addressing
Types ¶
type FakeDatapath ¶ added in v1.14.0
type FakeDatapath struct {
// contains filtered or unexported fields
}
func (*FakeDatapath) FakeNode ¶ added in v1.14.0
func (f *FakeDatapath) FakeNode() *FakeNodeHandler
func (*FakeDatapath) GetProxyPort ¶ added in v1.14.0
func (m *FakeDatapath) GetProxyPort(name string) uint16
func (*FakeDatapath) InstallNoTrackRules ¶ added in v1.14.0
func (m *FakeDatapath) InstallNoTrackRules(IP string, port uint16, ipv6 bool) error
func (*FakeDatapath) InstallProxyRules ¶ added in v1.14.0
func (*FakeDatapath) InstallRules ¶ added in v1.14.0
func (*FakeDatapath) LBMap ¶ added in v1.14.0
func (f *FakeDatapath) LBMap() types.LBMap
func (*FakeDatapath) LBMockMap ¶ added in v1.14.0
func (f *FakeDatapath) LBMockMap() *mockmaps.LBMockMap
func (*FakeDatapath) Loader ¶ added in v1.14.0
func (f *FakeDatapath) Loader() datapath.Loader
func (*FakeDatapath) LocalNodeAddressing ¶ added in v1.14.0
func (f *FakeDatapath) LocalNodeAddressing() types.NodeAddressing
LocalNodeAddressing returns a fake node addressing implementation of the local node
func (*FakeDatapath) Node ¶ added in v1.14.0
func (f *FakeDatapath) Node() datapath.NodeHandler
Node returns a fake handler for node events
func (*FakeDatapath) Procfs ¶ added in v1.14.0
func (f *FakeDatapath) Procfs() string
func (*FakeDatapath) RemoveNoTrackRules ¶ added in v1.14.0
func (m *FakeDatapath) RemoveNoTrackRules(IP string, port uint16, ipv6 bool) error
func (*FakeDatapath) SupportsOriginalSourceAddr ¶ added in v1.14.0
func (f *FakeDatapath) SupportsOriginalSourceAddr() bool
func (*FakeDatapath) WireguardAgent ¶ added in v1.14.0
func (f *FakeDatapath) WireguardAgent() datapath.WireguardAgent
func (*FakeDatapath) WriteEndpointConfig ¶ added in v1.14.0
func (f *FakeDatapath) WriteEndpointConfig(io.Writer, datapath.EndpointConfiguration) error
WriteEndpointConfig pretends to write the endpoint configuration to a writer.
func (*FakeDatapath) WriteNetdevConfig ¶ added in v1.14.0
func (f *FakeDatapath) WriteNetdevConfig(io.Writer, datapath.DeviceConfiguration) error
WriteNetdevConfig pretends to write the netdev configuration to a writer.
func (*FakeDatapath) WriteNodeConfig ¶ added in v1.14.0
func (f *FakeDatapath) WriteNodeConfig(io.Writer, *datapath.LocalNodeConfiguration) error
WriteNodeConfig pretends to write the datapath configuration to the writer.
func (*FakeDatapath) WriteTemplateConfig ¶ added in v1.14.0
func (f *FakeDatapath) WriteTemplateConfig(io.Writer, datapath.EndpointConfiguration) error
WriteTemplateConfig pretends to write the endpoint configuration to a writer.
type FakeNodeHandler ¶ added in v1.14.0
type FakeNodeHandler struct { Nodes map[string]nodeTypes.Node // contains filtered or unexported fields }
func NewNodeHandler ¶
func NewNodeHandler() *FakeNodeHandler
NewNodeHandler returns a fake NodeHandler that stores the nodes, but performs no other actions.
func (*FakeNodeHandler) AllocateNodeID ¶ added in v1.14.0
func (n *FakeNodeHandler) AllocateNodeID(_ net.IP) uint16
func (*FakeNodeHandler) DumpNodeIDs ¶ added in v1.14.0
func (n *FakeNodeHandler) DumpNodeIDs() []*models.NodeID
func (*FakeNodeHandler) NodeAdd ¶ added in v1.14.0
func (n *FakeNodeHandler) NodeAdd(newNode nodeTypes.Node) error
func (*FakeNodeHandler) NodeCleanNeighbors ¶ added in v1.14.0
func (n *FakeNodeHandler) NodeCleanNeighbors(migrateOnly bool)
func (*FakeNodeHandler) NodeConfigurationChanged ¶ added in v1.14.0
func (n *FakeNodeHandler) NodeConfigurationChanged(config datapath.LocalNodeConfiguration) error
func (*FakeNodeHandler) NodeDelete ¶ added in v1.14.0
func (n *FakeNodeHandler) NodeDelete(node nodeTypes.Node) error
func (*FakeNodeHandler) NodeNeighDiscoveryEnabled ¶ added in v1.14.0
func (n *FakeNodeHandler) NodeNeighDiscoveryEnabled() bool
func (*FakeNodeHandler) NodeNeighborRefresh ¶ added in v1.14.0
func (n *FakeNodeHandler) NodeNeighborRefresh(ctx context.Context, node nodeTypes.Node)
func (*FakeNodeHandler) NodeUpdate ¶ added in v1.14.0
func (n *FakeNodeHandler) NodeUpdate(oldNode, newNode nodeTypes.Node) error
func (*FakeNodeHandler) NodeValidateImplementation ¶ added in v1.14.0
func (n *FakeNodeHandler) NodeValidateImplementation(node nodeTypes.Node) error
func (*FakeNodeHandler) RestoreNodeIDs ¶ added in v1.14.0
func (n *FakeNodeHandler) RestoreNodeIDs()