convert

package
v1.0.0-beta.160 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DerefHeaderPtr

func DerefHeaderPtr[E any, T Header[E]](header *T) T

Safely dereference a pointer to a slice or map

func MapToPointer

func MapToPointer[T comparable, U any](value map[T]U) *map[T]U

func SafeDeRef

func SafeDeRef[T any, U any](value *T, fn func(T) *U) *U

SafeDeRef is a helper function to safely dereference a pointer and apply a function to it.

func SafeToUTC

func SafeToUTC(t *time.Time) *time.Time

func ToPointer

func ToPointer[T any](value T) *T

func ToStringLike

func ToStringLike[Source, Dest ~string](value *Source) *Dest

Types

type Header[E any] interface {
	map[string]E | []E
}

Header represents generic primitives with a header like map, slice, array...

Jump to

Keyboard shortcuts

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