v0.2.0 #3

Merged
kor-elf merged 22 commits from develop into main 2026-04-26 16:50:47 +05:00
Showing only changes of commit 6d62b280a1 - Show all commits
+32
View File
@@ -0,0 +1,32 @@
package batch
import (
"git.kor-elf.net/kor-elf-shield/go-nftables-client/contract"
"git.kor-elf.net/kor-elf-shield/go-nftables-client/internal/pkg"
)
type batch struct {
file *pkg.File
}
func NewBatch(file *pkg.File) contract.Batch {
return &batch{
file: file,
}
}
func (b *batch) Args() []string {
return []string{"-f", b.file.Path()}
}
func (b *batch) Check(command contract.Command) error {
return command.Run("-c", "-f", b.file.Path())
}
func (b *batch) Close() error {
return b.file.Remove()
}
func (b *batch) MoveFile(path string) error {
return b.file.Move(path)
}