Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/networkplumbing/go-nft

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/networkplumbing/go-nft

  • v0.4.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

go-nft

Licensed under Apache License version 2.0 Build Workflow Go Report Card

Go bindings for nft utility.

go-nft wraps invocation of the nft utility with functions to append and delete rules; create, clear and delete tables and chains.

To start using go-nft

go-nft is a library that provides a structured API to nftables.

go-nft uses the libnftables-json specification and exposes a subset of its structures.

  • Apply the configuration:
config := nft.NewConfig()
config.AddTable(nft.NewTable("mytable", nft.FamilyIP))
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
err := nft.ApplyConfigContext(ctx, config)
  • Read the configuration:
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
config, err := nft.ReadConfigContext(ctx)
nftVersion := config.Nftables[0].Metainfo.Version

For full setup example, see the integration test examples.

Contribution

We welcome contribution of any kind! Read CONTRIBUTING to learn how to contribute to the project.

Changelog

Please refer to CHANGELOG

FAQs

Package last updated on 28 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc