utils

package
v2.0.28 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: AGPL-3.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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