Documentation ¶
Index ¶
- type CtMockMap
- type LBMockMap
- func (m *LBMockMap) AddAffinityMatch(revNATID uint16, backendID uint16) error
- func (m *LBMockMap) AddBackend(id uint16, ip net.IP, port uint16, ipv6 bool) error
- func (m *LBMockMap) DeleteAffinityMatch(revNATID uint16, backendID uint16) error
- func (m *LBMockMap) DeleteBackendByID(id uint16, ipv6 bool) error
- func (m *LBMockMap) DeleteService(addr lb.L3n4AddrID, backendCount int, maglev bool) error
- func (m *LBMockMap) DumpAffinityMatches() (lbmap.BackendIDByServiceIDSet, error)
- func (m *LBMockMap) DumpBackendMaps() ([]*lb.Backend, error)
- func (m *LBMockMap) DumpServiceMaps() ([]*lb.SVC, []error)
- func (m *LBMockMap) DumpSourceRanges(ipv6 bool) (lbmap.SourceRangeSetByServiceID, error)
- func (*LBMockMap) IsMaglevLookupTableRecreated(ipv6 bool) bool
- func (m *LBMockMap) UpdateSourceRanges(revNATID uint16, prevRanges []*cidr.CIDR, ranges []*cidr.CIDR, ipv6 bool) error
- func (m *LBMockMap) UpsertMaglevLookupTable(svcID uint16, backends map[string]uint16, ipv6 bool) error
- func (m *LBMockMap) UpsertService(p *lbmap.UpsertServiceParams) error
- type MetricsMockMap
- type MetricsRecord
- type NatMockMap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CtMockMap ¶
type CtMockMap struct {
Entries []ctmap.CtMapRecord
}
CtMockMap implements the CtMap interface and can be used for unit tests.
func NewCtMockMap ¶
func NewCtMockMap(records []ctmap.CtMapRecord) *CtMockMap
NewCtMockMap is a constructor for a CtMockMap.
func (*CtMockMap) DumpEntries ¶
DumpEntries iterates through Map m and writes the values of the ct entries in m to a string.
func (*CtMockMap) DumpWithCallback ¶
func (m *CtMockMap) DumpWithCallback(cb bpf.DumpCallback) error
DumpWithCallback runs the callback on each entry of the mock map.
type LBMockMap ¶
type LBMockMap struct { BackendByID map[uint16]*lb.Backend ServiceByID map[uint16]*lb.SVC AffinityMatch lbmap.BackendIDByServiceIDSet SourceRanges lbmap.SourceRangeSetByServiceID DummyMaglevTable map[uint16]int // svcID => backends count }
func NewLBMockMap ¶
func NewLBMockMap() *LBMockMap
func (*LBMockMap) AddAffinityMatch ¶
func (*LBMockMap) AddBackend ¶
func (*LBMockMap) DeleteAffinityMatch ¶
func (*LBMockMap) DeleteBackendByID ¶
func (*LBMockMap) DeleteService ¶
func (*LBMockMap) DumpAffinityMatches ¶
func (m *LBMockMap) DumpAffinityMatches() (lbmap.BackendIDByServiceIDSet, error)
func (*LBMockMap) DumpSourceRanges ¶
func (m *LBMockMap) DumpSourceRanges(ipv6 bool) (lbmap.SourceRangeSetByServiceID, error)
func (*LBMockMap) IsMaglevLookupTableRecreated ¶
func (*LBMockMap) UpdateSourceRanges ¶
func (*LBMockMap) UpsertMaglevLookupTable ¶
func (*LBMockMap) UpsertService ¶
func (m *LBMockMap) UpsertService(p *lbmap.UpsertServiceParams) error
type MetricsMockMap ¶
type MetricsMockMap struct {
Entries []MetricsRecord
}
MetricsMockMap implements the MetricsMap interface and can be used for unit tests.
func NewMetricsMockMap ¶
func NewMetricsMockMap(records []MetricsRecord) *MetricsMockMap
NewMetricsMockMap is a constructor for a MetricsMockMap.
func (*MetricsMockMap) IterateWithCallback ¶
func (m *MetricsMockMap) IterateWithCallback(cb metricsmap.IterateCallback) error
DumpWithCallback runs the callback on each entry of the mock map.
type MetricsRecord ¶
type MetricsRecord struct { Key metricsmap.Key Values metricsmap.Values }
MetricsRecord designates a map entry (key + value). This type is used for mock maps.
type NatMockMap ¶
type NatMockMap struct {
Entries []nat.NatMapRecord
}
NatMockMap implements the NatMap interface and can be used for unit tests.
func NewNatMockMap ¶
func NewNatMockMap(records []nat.NatMapRecord) *NatMockMap
NewNatMockMap is a constructor for a NatMockMap.
func (*NatMockMap) Close ¶
func (m *NatMockMap) Close() error
Close does nothing, mock maps need not be closed either.
func (*NatMockMap) DumpEntries ¶
func (m *NatMockMap) DumpEntries() (string, error)
DumpEntries iterates through Map m and writes the values of the ct entries in m to a string.
func (*NatMockMap) DumpWithCallback ¶
func (m *NatMockMap) DumpWithCallback(cb bpf.DumpCallback) error
DumpWithCallback runs the callback on each entry of the mock map.
func (*NatMockMap) Open ¶
func (m *NatMockMap) Open() error
Open does nothing, mock maps need not be opened.
func (*NatMockMap) Path ¶
func (m *NatMockMap) Path() (string, error)
Path returns a mock path for the mock map.