Refactor to consolidate APIs into contract package and introduce NFT interface for better modularity and maintainability.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package contract
|
||||
|
||||
import "git.kor-elf.net/kor-elf-shield/go-nftables-client/contract/nft"
|
||||
|
||||
// NFT A client for working with nftables
|
||||
type NFT interface {
|
||||
// Command returns the command used to execute nft.
|
||||
// You can execute your raw request.
|
||||
Command() Command
|
||||
|
||||
// Clear clears all rules.
|
||||
//
|
||||
// This command is equivalent to:
|
||||
// nft flush ruleset
|
||||
Clear() error
|
||||
|
||||
// Version returns the version of nftables.
|
||||
//
|
||||
// This command is equivalent to:
|
||||
// nft -V
|
||||
Version() (nft.Version, error)
|
||||
|
||||
// Table returns an API for working with tables.
|
||||
Table() nft.Table
|
||||
|
||||
// Chain returns an API for working with chains.
|
||||
Chain() nft.Chain
|
||||
|
||||
// Rule returns an API for working with rules.
|
||||
Rule() nft.Rule
|
||||
}
|
||||
Reference in New Issue
Block a user