Refactor to consolidate APIs into contract package and introduce NFT interface for better modularity and maintainability.

This commit is contained in:
2026-04-22 21:54:59 +05:00
parent 92803286f5
commit 3c47e7566b
12 changed files with 182 additions and 154 deletions
+3 -9
View File
@@ -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
}