utils

package
v2.0.26 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecompressGzipped

func DecompressGzipped(r io.Reader) ([]byte, error)

func DecompressGzippedBytes

func DecompressGzippedBytes(data []byte) ([]byte, error)

func DedupeStrings

func DedupeStrings(input []string) []string

DedupeStrings take a slice of string and dedupe it

func GetHostname

func GetHostname() string

func GetOutboundIP

func GetOutboundIP() net.IP

Note: GetOutboundIP does not establish any connection and the destination does not need to exist for this function to work.

func IsMIMETypeInHierarchy

func IsMIMETypeInHierarchy(m *mimetype.MIME, expectedMIME string) bool

IsMIMETypeInHierarchy recursively checks if the MIME type and its parents match the expected MIME type

func MustDecompressGzippedBytes

func MustDecompressGzippedBytes(data []byte) []byte

func Pointer

func Pointer[T any](d T) *T

func StringContainsSliceElements

func StringContainsSliceElements(target string, slice []string) bool

StringContainsSliceElements if the string contains one of the elements of a slice

func StringSliceToURLSlice

func StringSliceToURLSlice(rawURLs []string) (URLs []*url.URL)

StringSliceToURLSlice takes a slice of string and return a slice of url.URL

Types

type TAtomBool

type TAtomBool struct {
	// contains filtered or unexported fields
}

TAtomBool define an atomic boolean

func (*TAtomBool) Get

func (b *TAtomBool) Get() bool

Get return the value of an atomic boolean

func (*TAtomBool) Set

func (b *TAtomBool) Set(value bool)

Set set the value of an atomic boolean

type Version

type Version struct {
	Version     string
	GoVersion   string
	WarcVersion string
	ZenoVersion string
}

func GetVersion

func GetVersion() (version Version)

Jump to

Keyboard shortcuts

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