Refactor table commands to use nftCommand utilities for improved code reuse

This commit is contained in:
2026-04-26 15:47:48 +05:00
parent 04b70ce5ec
commit fedf0966bc
2 changed files with 19 additions and 3 deletions
+15
View File
@@ -0,0 +1,15 @@
package nft
import "git.kor-elf.net/kor-elf-shield/go-nftables-client/family"
func TableAdd(family family.Type, tableName string) []string {
return []string{"add", "table", family.String(), tableName}
}
func TableDelete(family family.Type, tableName string) []string {
return []string{"delete", "table", family.String(), tableName}
}
func TableClear(family family.Type, tableName string) []string {
return []string{"flush", "table", family.String(), tableName}
}