ipset

package
v1.12.3 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v1.7.3

type Client struct{}

func NewClient added in v1.7.3

func NewClient() *Client

func (*Client) AddEntry added in v1.7.3

func (c *Client) AddEntry(name string, entry string) error

AddEntry adds a new entry to the set, it will ignore error when the entry already exists.

func (*Client) CreateIPSet added in v1.7.3

func (c *Client) CreateIPSet(name string, setType SetType, isIPv6 bool) error

CreateIPSet creates a new set, it will ignore error when the set already exists.

func (*Client) DelEntry added in v1.7.3

func (c *Client) DelEntry(name string, entry string) error

DelEntry deletes the entry from the set, it will ignore error when the entry doesn't exist.

func (*Client) ListEntries added in v1.7.3

func (c *Client) ListEntries(name string) ([]string, error)

ListEntries lists all the entries of the set.

type Interface added in v1.7.3

type Interface interface {
	CreateIPSet(name string, setType SetType, isIPv6 bool) error

	AddEntry(name string, entry string) error

	DelEntry(name string, entry string) error

	ListEntries(name string) ([]string, error)
}

type SetType

type SetType string
const (
	// The hash:net set type uses a hash to store different sized IP network addresses.
	// The lookup time grows linearly with the number of the different prefix values added to the set.
	HashNet    SetType = "hash:net"
	HashIP     SetType = "hash:ip"
	HashIPPort SetType = "hash:ip,port"
)

Directories

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

Jump to

Keyboard shortcuts

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