Add Command method to NFT interface and RunWithOutput support to command package
This commit is contained in:
@@ -6,7 +6,10 @@ import (
|
||||
)
|
||||
|
||||
type NFT interface {
|
||||
// Run nft command.
|
||||
Run(arg ...string) error
|
||||
|
||||
// RunWithOutput Run nft command with output.
|
||||
RunWithOutput(arg ...string) (string, error)
|
||||
}
|
||||
|
||||
|
||||
8
nft.go
8
nft.go
@@ -12,6 +12,10 @@ import (
|
||||
|
||||
// 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.NFT
|
||||
|
||||
// Clear clears all rules.
|
||||
//
|
||||
// This command is equivalent to:
|
||||
@@ -111,3 +115,7 @@ func (n *nft) Table() table.API {
|
||||
func (n *nft) Chain() chain.API {
|
||||
return n.chain
|
||||
}
|
||||
|
||||
func (n *nft) Command() command.NFT {
|
||||
return n.command
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user