kubernetes/vendor/sigs.k8s.io/knftables/fake.go

type Fake

type FakeTable

type FakeChain

type FakeSet

type FakeMap

// NewFake creates a new fake Interface, for unit tests
func NewFake(family Family, table string) *Fake {}

var _

// List is part of Interface.
func (fake *Fake) List(_ context.Context, objectType string) ([]string, error) {}

// ListRules is part of Interface
func (fake *Fake) ListRules(_ context.Context, chain string) ([]*Rule, error) {}

// ListElements is part of Interface
func (fake *Fake) ListElements(_ context.Context, objectType, name string) ([]*Element, error) {}

// NewTransaction is part of Interface
func (fake *Fake) NewTransaction() *Transaction {}

// Run is part of Interface
func (fake *Fake) Run(_ context.Context, tx *Transaction) error {}

// Check is part of Interface
func (fake *Fake) Check(_ context.Context, tx *Transaction) error {}

func (fake *Fake) run(tx *Transaction) (*FakeTable, error) {}

func checkExists(verb verb, objectType, name string, exists bool) error {}

// checkRuleRefs checks for chains, sets, and maps referenced by rule in table
func checkRuleRefs(rule *Rule, table *FakeTable) error {}

// checkElementRefs checks for chains referenced by an element
func checkElementRefs(element *Element, table *FakeTable) error {}

// Dump dumps the current contents of fake, in a way that looks like an nft transaction.
func (fake *Fake) Dump() string {}

// ParseDump can parse a dump for a given nft instance.
// It expects fake's table name and family in all rules.
// The best way to verify that everything important was properly parsed is to
// compare given data with nft.Dump() output.
func (fake *Fake) ParseDump(data string) (err error) {}

func sortKeys[K ~string, V any](m map[K]V) []K {}

func findRule(rules []*Rule, handle int) int {}

func findElement(elements []*Element, key []string) int {}

// copy creates a copy of table with new arrays/maps so we can perform a transaction
// on it without changing the original table.
func (table *FakeTable) copy() *FakeTable {}

// FindElement finds an element of the set with the given key. If there is no matching
// element, it returns nil.
func (s *FakeSet) FindElement(key ...string) *Element {}

// FindElement finds an element of the map with the given key. If there is no matching
// element, it returns nil.
func (m *FakeMap) FindElement(key ...string) *Element {}