ipset

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: MIT Imports: 4 Imported by: 0

README

go-ipset

These are bindings to libipset3. Currently there is only support for adding and removing entries to/from existing sets. If you need a more feature-rich library then take a look at janeczku/go-ipset.

Installation

Install dependencies:

On Debian/Ubuntu execute:

apt install libipset-dev pkg-config

Install go-ipset using the go get command:

go get github.com/digineo/go-ipset

Usage

Create the ipset before:

ipset create myset hash:ip timeout 0

Add the import to your program:

import "github.com/digineo/go-ipset"
Add a single entry to the set
ipset.Add("myset", "192.0.2.23")                  // without timeout
ipset.Add("myset", "192.0.2.23", "timeout", "42") // with timeout
Remove a single entry from the set
ipset.Del("myset", "192.0.2.23")

Documentation

Overview

apt install ipset-dev

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(setname, address string, args ...string) error

func Del

func Del(setname, address string, args ...string) error

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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