util

package
v0.0.0-...-854d982 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const MaxItemsPerPage = 5000

MaxItemsPerPage is the maximum number of items that can be requested per page

Variables

This section is empty.

Functions

func Clamp

func Clamp[T cmp.Ordered](this, min, max T) T

Clamp returns `this` if it is between `min` and `max`, otherwise the closest bound

func IsValueEmpty

func IsValueEmpty(value any) bool

Types

type KV

type KV map[string]any

func Data

func Data(data KV) KV

func DataGUID

func DataGUID(guid string) KV

func (KV) AsMap

func (kv KV) AsMap() map[string]any

AsMap converts a KV to a map[string]any This is useful for long keys with dots, e.g. "a.b.c" which will be converted to {"a": {"b": {"c": ...}}}

type Query

type Query map[string]string

func CreateQueryParams

func CreateQueryParams(values Query, perPage ...int) Query

Jump to

Keyboard shortcuts

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