common

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOverlayHierarchicalKey = fmt.Errorf("overlay hierarchical key")
)

Functions

func ARangeU32

func ARangeU32(n uint32) []uint32

func AddrToDnsType

func AddrToDnsType(addr netip.Addr) uint16

func Base64StdDecode

func Base64StdDecode(s string) (string, error)

func Base64UrlDecode

func Base64UrlDecode(s string) (string, error)

func BoolToString

func BoolToString(b bool) string

func CloneStrings

func CloneStrings(slice []string) []string

func ConvergeAddr

func ConvergeAddr(addr netip.Addr) netip.Addr

func ConvergeAddrPort

func ConvergeAddrPort(addrPort netip.AddrPort) netip.AddrPort

func Deduplicate

func Deduplicate(list []string) []string

func EnsureFileInSubDir

func EnsureFileInSubDir(filePath string, dir string) (err error)

func FuzzyDecode

func FuzzyDecode(to interface{}, val string) bool

func GenerateCertChainHash added in v0.2.4

func GenerateCertChainHash(rawCerts [][]byte) (chainHash []byte)

func GetDefaultIfnames added in v0.1.3

func GetDefaultIfnames() (defaultIfs []string, err error)

func GetTagFromLinkLikePlaintext

func GetTagFromLinkLikePlaintext(link string) (tag string, afterTag string)

func GetValueHierarchicalStruct

func GetValueHierarchicalStruct(m interface{}, key string) (reflect.Value, error)

func Htons

func Htons(i uint16) uint16

Htons converts the unsigned short integer hostshort from host byte order to network byte order.

func Ipv6ByteSliceToUint32Array

func Ipv6ByteSliceToUint32Array(_ip []byte) (ip [4]uint32)

func Ipv6ByteSliceToUint8Array

func Ipv6ByteSliceToUint8Array(_ip []byte) (ip [16]uint8)

func Ipv6Uint32ArrayToByteSlice

func Ipv6Uint32ArrayToByteSlice(_ip [4]uint32) (ip []byte)

func IsValidHttpMethod added in v0.1.10

func IsValidHttpMethod(method string) bool

func MagicNetwork added in v0.2.0

func MagicNetwork(network string, mark uint32, mptcp bool) string

func MapKeys

func MapKeys(m interface{}) (keys []string, err error)

func NewGcm

func NewGcm(key []byte) (cipher.AEAD, error)

func Ntohs

func Ntohs(i uint16) uint16

Ntohs converts the unsigned short integer hostshort from host byte order to network byte order.

func ParseMac

func ParseMac(mac string) (addr [6]byte, err error)

func ParsePortRange

func ParsePortRange(pr string) (portRange [2]uint16, err error)

func ReportMemory

func ReportMemory(tag string)

func SetValue

func SetValue(values *url.Values, key string, value string)

func SetValueHierarchicalMap

func SetValueHierarchicalMap(m map[string]interface{}, key string, val interface{}) error

func SetValueHierarchicalStruct

func SetValueHierarchicalStruct(m interface{}, key string, val string) error

func StringSet added in v0.2.0

func StringSet(list []string) map[string]struct{}

Types

type UrlOrEmpty

type UrlOrEmpty struct {
	Url   *url.URL
	Empty bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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