iptableswrapper

package
v1.18.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package iptableswrapper is a wrapper interface for the iptables package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPTablesIface

type IPTablesIface interface {
	Exists(table, chain string, rulespec ...string) (bool, error)
	Insert(table, chain string, pos int, rulespec ...string) error
	Append(table, chain string, rulespec ...string) error
	AppendUnique(table, chain string, rulespec ...string) error
	Delete(table, chain string, rulespec ...string) error
	List(table, chain string) ([]string, error)
	NewChain(table, chain string) error
	ClearChain(table, chain string) error
	DeleteChain(table, chain string) error
	ListChains(table string) ([]string, error)
	ChainExists(table, chain string) (bool, error)
	HasRandomFully() bool
}

IPTablesIface is an interface created to make code unit testable. Both the iptables package version and mocked version implement the same interface

func NewIPTables

func NewIPTables(protocol iptables.Protocol) (IPTablesIface, error)

NewIPTables return a ipTables struct that implements IPTablesIface

Directories

Path Synopsis
Package mock_iptableswrapper is a generated GoMock package.
Package mock_iptableswrapper is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL