utils

package
Version: v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2019 License: Apache-2.0 Imports: 2 Imported by: 20

Documentation

Index

Constants

View Source
const MaxHashLen = sha512.Size * 2

Variables

This section is empty.

Functions

func FormatChainName

func FormatChainName(name string, id string) string

FormatChainName generates a chain name to be used with iptables. Ensures that the generated chain name is exactly maxChainLength chars in length.

func FormatComment

func FormatComment(name string, id string) string

FormatComment returns a comment used for easier rule identification within iptables.

func MustFormatChainNameWithPrefix added in v0.8.2

func MustFormatChainNameWithPrefix(name string, id string, prefix string) string

MustFormatChainNameWithPrefix generates a chain name similar to FormatChainName, but adds a custom prefix between chainPrefix and unique identifier. Ensures that the generated chain name is exactly maxChainLength chars in length. Panics if the given prefix is too long.

func MustFormatHashWithPrefix added in v0.8.2

func MustFormatHashWithPrefix(length int, prefix string, toHash string) string

MustFormatHashWithPrefix returns a string of given length that begins with the given prefix. It is filled with entropy based on the given string toHash.

Types

This section is empty.

Source Files

Directories

Path Synopsis
Buildversion is a destination for the linker trickery so we can auto set the build-version
Buildversion is a destination for the linker trickery so we can auto set the build-version

Jump to

Keyboard shortcuts

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