v0.2.0 #3
@@ -0,0 +1,23 @@
|
|||||||
|
package batch
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"git.kor-elf.net/kor-elf-shield/go-nftables-client/contract"
|
||||||
|
"git.kor-elf.net/kor-elf-shield/go-nftables-client/internal/pkg"
|
||||||
|
)
|
||||||
|
|
||||||
|
type commandRun struct {
|
||||||
|
file *pkg.File
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCommand(file *pkg.File) contract.CommandRun {
|
||||||
|
return &commandRun{
|
||||||
|
file: file,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *commandRun) Run(args ...string) error {
|
||||||
|
_, err := c.file.Write([]byte(fmt.Sprintf("%s\n", args)))
|
||||||
|
return err
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user