Versions in this module Expand all Collapse all v0 v0.0.1 Jul 25, 2023 Changes in this version + const ContentEncodingGZIP + const ContentEncodingHeader + const DefaultIPv4 + const DefaultIPv6 + var ErrKeysDontMatch = errors.New("keys don't match") + var ErrLengthsDontMatch = errors.New("lengths don't match") + var ErrTypesDontMatch = errors.New("types don't match") + var ErrValuesDontMatch = errors.New("values don't match") + func AreSlicesIntersect(slice1, slice2 []T) bool + func CloneRequestBody(r *http.Request) (body string) + func CloneResponseBody(r *http.Response) (body string) + func CloserFunc(r io.Reader, close func() error) io.ReadCloser + func DurationUntilNextInterval(now time.Time, interval time.Duration) time.Duration + func EscapeChars(str string, chars map[rune]struct{}) string + func FillEmptyIP(ipv4, ipv6 string) (string, string) + func FuncName() string + func GetFirst(str string) string + func GetRequestIP(r *http.Request) (requestIP string) + func GetSecond(str string) string + func IsInSlice(i T, slice []T) bool + func JoinIPVersions(ipv4, ipv6 string) (ip string) + func JoinParams(first, second string) string + func JoinQuoted(lines []string, quote, separator string) string + func JoinQuotedInt(lines []int, quote, separator string) string + func Retry(f func() error, times int) + func RetryOverTime(f func() error, timeout time.Duration, tick time.Duration) error + func SQLReplaceArgs(query string, args ...any) string + func SetCORS(w http.ResponseWriter) + func SetContentTypeHeader(w http.ResponseWriter, contentType ContentType) + func SetCorsHeader(w http.ResponseWriter) + func SplitIPVersions(ip string) (ipv4, ipv6 string) + func ToUnderscoreACII(s string) (underscored string) + func UnGzipBody(bodyContent []byte) ([]byte, error) + type Commission Percent + func (e Commission) AddTo(value float64) float64 + func (e Commission) SubtractFrom(value float64) float64 + type ContentType string + const ContentTypeApplicationJSON + const ContentTypeTextHTML + type Diff struct + Error error + Left string + Path string + Right string + type Diffs []Diff + func CompareJSON(leftJSON, rightJSON string) (diff Diffs, err error) + func (ds Diffs) String() string + type Distribution []float64 + func (d *Distribution) GetMax() float64 + func (d *Distribution) GetMin() float64 + func (d *Distribution) GetQuantileValue(quantileNumber uint) float64 + func (d *Distribution) TrimMax(difference float64) + type Percent float64 + const OnePercent + func PercentFrom(percent percentT) Percent + func (p *Percent) MarshalJSON() ([]byte, error) + func (p *Percent) UnmarshalJSON(data []byte) error + func (p Percent) Float64() float64 + func (p Percent) Scale(val float64) float64 + func (p Percent) ScaleReversed(val float64) float64 + func (p Percent) String() string + type SQLStringValue string + func ToSQLStringValue(lines ...string) []SQLStringValue + type Set map[data]struct + func NewSet() Set[dataType] + func (s Set[dataType]) Add(data ...dataType) + func (s Set[dataType]) Delete(data dataType) + func (s Set[dataType]) Exists(data dataType) bool + func (s Set[dataType]) Values() []dataType