Documentation ¶
Index ¶
- type CtMockMap
- type LBMockMap
- func (m *LBMockMap) AddAffinityMatch(revNATID uint16, backendID lb.BackendID) error
- func (m *LBMockMap) AddBackend(b *lb.Backend, ipv6 bool) error
- func (m *LBMockMap) DeleteAffinityMatch(revNATID uint16, backendID lb.BackendID) error
- func (m *LBMockMap) DeleteBackendByID(id lb.BackendID) error
- func (m *LBMockMap) DeleteService(addr lb.L3n4AddrID, backendCount int, maglev bool, natPolicy lb.SVCNatPolicy) error
- func (m *LBMockMap) DumpAffinityMatches() (datapathTypes.BackendIDByServiceIDSet, error)
- func (m *LBMockMap) DumpBackendMaps() ([]*lb.Backend, error)
- func (m *LBMockMap) DumpServiceMaps() ([]*lb.SVC, []error)
- func (m *LBMockMap) DumpSourceRanges(ipv6 bool) (datapathTypes.SourceRangeSetByServiceID, error)
- func (*LBMockMap) IsMaglevLookupTableRecreated(ipv6 bool) bool
- func (m *LBMockMap) UpdateBackendWithState(b *lb.Backend) error
- func (m *LBMockMap) UpdateSourceRanges(revNATID uint16, prevRanges []*cidr.CIDR, ranges []*cidr.CIDR, ipv6 bool) error
- func (m *LBMockMap) UpsertMaglevLookupTable(svcID uint16, backends map[string]*lb.Backend, ipv6 bool) error
- func (m *LBMockMap) UpsertService(p *datapathTypes.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 { lock.Mutex BackendByID map[lb.BackendID]*lb.Backend ServiceByID map[uint16]*lb.SVC AffinityMatch datapathTypes.BackendIDByServiceIDSet SourceRanges datapathTypes.SourceRangeSetByServiceID DummyMaglevTable map[uint16]int // svcID => backends count SvcActiveBackendsCount map[uint16]int }
func NewLBMockMap ¶
func NewLBMockMap() *LBMockMap
func (*LBMockMap) AddAffinityMatch ¶
func (*LBMockMap) DeleteAffinityMatch ¶
func (*LBMockMap) DeleteService ¶
func (m *LBMockMap) DeleteService(addr lb.L3n4AddrID, backendCount int, maglev bool, natPolicy lb.SVCNatPolicy) error
func (*LBMockMap) DumpAffinityMatches ¶
func (m *LBMockMap) DumpAffinityMatches() (datapathTypes.BackendIDByServiceIDSet, error)
func (*LBMockMap) DumpSourceRanges ¶
func (m *LBMockMap) DumpSourceRanges(ipv6 bool) (datapathTypes.SourceRangeSetByServiceID, error)
func (*LBMockMap) IsMaglevLookupTableRecreated ¶
func (*LBMockMap) UpdateBackendWithState ¶
func (*LBMockMap) UpdateSourceRanges ¶
func (*LBMockMap) UpsertMaglevLookupTable ¶
func (*LBMockMap) UpsertService ¶
func (m *LBMockMap) UpsertService(p *datapathTypes.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.