utils

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package utils provides utility functions.

This is bad practice to name like this. I know.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flush

func Flush[T any](msgChan chan T)

Flush flushes the messages from the channel.

func GenerateRandomString

func GenerateRandomString(n int) string

GenerateRandomString generates a random string of length n.

func Hash added in v1.4.2

func Hash(o any) string

Hash returns the hash of the object.

func MockRandomString

func MockRandomString(s string)

MockRandomString mocks the random string generation.

func OverrideRandSource

func OverrideRandSource(s rand.Source)

OverrideRandSource overrides the random source.

func SanitizeFilename

func SanitizeFilename(filename string) string

SanitizeFilename sanitizes the filename.

Types

This section is empty.

Directories

Path Synopsis
Package channel describes functions for working with channels.
Package channel describes functions for working with channels.
Package ptr provides a simple way to get the pointer of a value.
Package ptr provides a simple way to get the pointer of a value.
Package secret provides a way to read user credentials.
Package secret provides a way to read user credentials.
Package strings handle various strings manipulation.
Package strings handle various strings manipulation.
Package sync provides a thread-safe structures.
Package sync provides a thread-safe structures.
Package try provides a set of functions to retry a function with a delay.
Package try provides a set of functions to retry a function with a delay.
Package useragent provides a way to get a user agent.
Package useragent provides a way to get a user agent.

Jump to

Keyboard shortcuts

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