utils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultIfZero

func DefaultIfZero[T any](v T, fallback T) T

func DurationS

func DurationS(seconds int64) time.Duration

func HeaderMap

func HeaderMap(header http.Header) map[string]string

func IsValidUUID

func IsValidUUID(id string) bool

func JsonResponse

func JsonResponse(code int, w http.ResponseWriter, data interface{})

func KSUID

func KSUID() string

func Must

func Must[T any](v T, err error) T

func Pointer

func Pointer[T any](v T) *T

func PointerValue

func PointerValue[T any](v *T) T

func RandomString added in v0.2.0

func RandomString(n int) string

func UUID

func UUID() string

func UUIDShort

func UUIDShort() string

func Validate

func Validate(v interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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