Refactor to consolidate APIs into contract package and introduce NFT interface for better modularity and maintainability.
This commit is contained in:
@@ -3,21 +3,15 @@ package command
|
||||
import (
|
||||
"errors"
|
||||
"os/exec"
|
||||
|
||||
"git.kor-elf.net/kor-elf-shield/go-nftables-client/contract"
|
||||
)
|
||||
|
||||
type NFT interface {
|
||||
// Run nft command.
|
||||
Run(arg ...string) error
|
||||
|
||||
// RunWithOutput Run nft command with output.
|
||||
RunWithOutput(arg ...string) (string, error)
|
||||
}
|
||||
|
||||
type execNFT struct {
|
||||
nftPath string
|
||||
}
|
||||
|
||||
func New(path string) (NFT, error) {
|
||||
func New(path string) (contract.Command, error) {
|
||||
if err := checkingNFT(path); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user