Documentation ¶
Index ¶
- Variables
- func AnyEvilCharacter(phrase string) bool
- func ChecksumCRC32(reader io.Reader) (checksum string, err error)
- func ChunkBy[T any](items []T, chunkSize int) (chunks [][]T)
- func DurationToSeconds(duration string) (seconds float64)
- func GetUserAgent() string
- func IsEmpty(in any) bool
- func LowerCaseRemoveSpecial(phrase string) string
- func MergeChan[N any](cs ...<-chan N) <-chan N
- func NewIdentifier() string
- func NumericQuality(quality string) (numeric int)
- func Ordinal(x int) string
- func ParseIP(s string) (ip net.IP)
- func PointerOf[T any](t T) *T
- func RabinKarp(phrase string, patterns []string) int
- func RealRemoteAddr(r *http.Request) (host, port string, err error)
- func RemoveEvilCharacters(phrase string, replaceSpaces ...bool) string
- func SecondsToDuration(seconds float64) string
- func SetUserAgent(req *http.Request)
- func SurroundWith(with rune, strs ...string) string
- func TillEndOfDay() time.Duration
- func TryCast[T any](s interface{}) (T, error)
- func Unpad(phrase string) (out string)
- func ValueOf[T any](t *T) (v T)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AnyEvilCharacter ¶
AnyEvilCharacter any character in the switch below will return true on 1st find. Source: https://github.com/dinoex/iroffer-dinoex/blob/master/src/dinoex_utilities.c#L555
func ChecksumCRC32 ¶
ChecksumCRC32 returns a crc32 hash from the specified reader
func DurationToSeconds ¶
func GetUserAgent ¶
func GetUserAgent() string
GetUserAgent returns a random user agent from the private pre-defined user agent array.
func LowerCaseRemoveSpecial ¶
LowerCaseRemoveSpecial removes special characters from a string, while converting the letters to lowercase.
func MergeChan ¶
func MergeChan[N any](cs ...<-chan N) <-chan N
MergeChan merges all the channels and outputs them into one, following the Fan-In Fan-Out pattern.
func NewIdentifier ¶
func NewIdentifier() string
func NumericQuality ¶
func RabinKarp ¶
RabinKarp searches given patterns in phrase and returns the number of matched ones. Returns a zero is there are no matches.
func RealRemoteAddr ¶
RealRemoteAddr first attempts to retrieve the address from the 'X-Forwarded-For' if that fails, it attempts to retrieve from the special headers.
func RemoveEvilCharacters ¶
RemoveEvilCharacters strips special characters by replacing them with underscores. Source: https://github.com/dinoex/iroffer-dinoex/blob/master/src/dinoex_utilities.c#L555
func SecondsToDuration ¶
func SetUserAgent ¶
func SurroundWith ¶
func TillEndOfDay ¶
TillEndOfDay returns the time duration for UTC till we reach end of day.
Types ¶
This section is empty.