MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / GetRules

Method GetRules

internal/firewalls/nftables/chain.go:346–356  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

344}
345
346func (this *Chain) GetRules() ([]*Rule, error) {
347 rawRules, err := this.conn.Raw().GetRule(this.rawTable, this.rawChain)
348 if err != nil {
349 return nil, err
350 }
351 var result = []*Rule{}
352 for _, rawRule := range rawRules {
353 result = append(result, NewRule(rawRule))
354 }
355 return result, nil
356}
357
358func (this *Chain) DeleteRule(rule *Rule) error {
359 err := this.conn.Raw().DelRule(rule.Raw())

Callers 2

getRulesMethod · 0.80
TestChain_GetRulesFunction · 0.80

Calls 2

NewRuleFunction · 0.70
RawMethod · 0.45

Tested by 1

TestChain_GetRulesFunction · 0.64