32 lines
652 B
Go
32 lines
652 B
Go
package contract
|
|
|
|
import (
|
|
"git.kor-elf.net/kor-elf-shield/go-nftables-client/contract/batch"
|
|
)
|
|
|
|
// BatchBuilder is an API for building a batch of commands.
|
|
type BatchBuilder interface {
|
|
// Clear clears all rules.
|
|
//
|
|
// This command is equivalent to:
|
|
// nft flush ruleset
|
|
Clear() error
|
|
|
|
// Table returns an API for working with tables.
|
|
Table() batch.Table
|
|
|
|
// Chain returns an API for working with chains.
|
|
Chain() batch.Chain
|
|
|
|
// Rule returns an API for working with rules.
|
|
Rule() batch.Rule
|
|
|
|
// Build returns a batch of commands.
|
|
Build() Batch
|
|
}
|
|
|
|
type Batch interface {
|
|
// Args returns the arguments of the batch.
|
|
Args() []string
|
|
}
|