package
0.0.0-20250226171102-4db14ec44d68
Repository: https://github.com/cozy/cozy-stack.git
Documentation: pkg.go.dev

# Functions

AbsPath returns an absolute path relative.
CheckPreconditions evaluates request preconditions based only on the Etag values.
CleanUTF8 returns a string with only valid UTF-8 runes.
CloneURL clones the given url.
CookieDomain removes the port and does IDNA encoding.
DirExists returns whether or not the directory exists on the current file system.
DurationFuzzing returns a duration that is near the given duration, but randomized to avoid patterns like several cache entries that expires at the same time.
FileExists returns whether or not the file exists on the current file system.
IsInArray returns whether or not a string is in the given array of strings.
LimitWriter works like io.LimitReader.
LimitWriterDiscard works like io.LimitReader.
NewGroupShutdown returns a new GroupShutdown.
NewSeededRand returns a random bytes reader initialized with the given seed.
RandomString returns a string of random alpha characters of the specified length.
RandomStringFast returns a random string containing printable ascii characters: [0-9a-zA-Z_-]{n}.
ReadCloser returns an io.ReadCloser from a io.Reader and a close method.
RetryWithExpBackoff can be used to call several times a function until it returns no error or the maximum count of calls has been reached.
SplitTrimString slices s into all substrings a s separated by sep, like strings.Split.
StripPort extract the domain name from a domain:port string.
TrimStrings trim all strings and filter out the empty ones.
UniqueStrings returns a filtered slice without string duplicates.
WriteCloser returns an io.WriteCloser from a io.Writer and a close method.

# Variables

NopShutdown implements the Shutdowner interface but does not execute any process on shutdown.

# Structs

GroupShutdown allow to group multiple Shutdowner into a single one.

# Interfaces

Shutdowner is an interface with a Shutdown method to gracefully shutdown a running process.