util

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default[T any](value *T, defaultValue *T) *T

func DefaultString

func DefaultString(value string, defaultValue string) string

func EnvVarCheckBool

func EnvVarCheckBool(name string) bool

func GobHash

func GobHash(objs ...any) (uint32, error)

func GobHashBytes

func GobHashBytes(objs ...any) (uint32, error)

func JsonError

func JsonError[T any](w http.ResponseWriter, statusCode int, message T)

func JsonErrors

func JsonErrors[T any](w http.ResponseWriter, statusCode int, message []T)

func JsonHash

func JsonHash(objs ...any) (uint32, error)

func JsonHashBytes

func JsonHashBytes(objs ...any) ([]byte, error)

func JsonResponse

func JsonResponse(w http.ResponseWriter, statusCode int, data any)

func ParseInt

func ParseInt(s string, def int) (int, error)

func ToBytes

func ToBytes(a any) ([]byte, error)

func WriteStatusCodeError

func WriteStatusCodeError(w http.ResponseWriter, code int)

Types

This section is empty.

Directories

Path Synopsis
tree
avl

Jump to

Keyboard shortcuts

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