Changed the name parameter to nameTable in methods for working with tables.

This commit is contained in:
2025-10-19 21:12:25 +05:00
parent 1a62968d1d
commit d056f5dbf8

24
nft.go
View File

@@ -15,20 +15,20 @@ type NFT interface {
// AddTable adds a new table. // AddTable adds a new table.
// //
// This command is equivalent to: // This command is equivalent to:
// nft add table (ip|ip6|inet|arp|bridge) {name} // nft add table (ip|ip6|inet|arp|bridge) {table_name}
AddTable(family FamilyType, name string) error AddTable(family FamilyType, tableName string) error
// DeleteTable deletes a table. // DeleteTable deletes a table.
// //
// This command is equivalent to: // This command is equivalent to:
// nft delete table (ip|ip6|inet|arp|bridge) {name} // nft delete table (ip|ip6|inet|arp|bridge) {table_name}
DeleteTable(family FamilyType, name string) error DeleteTable(family FamilyType, tableName string) error
// ClearTable clears all rules in a table. // ClearTable clears all rules in a table.
// //
// This command is equivalent to: // This command is equivalent to:
// nft flush table (ip|ip6|inet|arp|bridge) {name} // nft flush table (ip|ip6|inet|arp|bridge) {table_name}
ClearTable(family FamilyType, name string) error ClearTable(family FamilyType, tableName string) error
} }
type nft struct { type nft struct {
@@ -65,17 +65,17 @@ func (n *nft) Clear() error {
return executeCommand(n.path, args...) return executeCommand(n.path, args...)
} }
func (n *nft) AddTable(family FamilyType, name string) error { func (n *nft) AddTable(family FamilyType, tableName string) error {
args := []string{"add", "table", family.String(), name} args := []string{"add", "table", family.String(), tableName}
return executeCommand(n.path, args...) return executeCommand(n.path, args...)
} }
func (n *nft) DeleteTable(family FamilyType, name string) error { func (n *nft) DeleteTable(family FamilyType, tableName string) error {
args := []string{"delete", "table", family.String(), name} args := []string{"delete", "table", family.String(), tableName}
return executeCommand(n.path, args...) return executeCommand(n.path, args...)
} }
func (n *nft) ClearTable(family FamilyType, name string) error { func (n *nft) ClearTable(family FamilyType, tableName string) error {
args := []string{"flush", "table", family.String(), name} args := []string{"flush", "table", family.String(), tableName}
return executeCommand(n.path, args...) return executeCommand(n.path, args...)
} }