utils

package
v0.0.0-...-5d22fbd Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromValue

func FromValue[T any](s *T) T

FromValue returns the string from the memory address.

func GenerateUUID

func GenerateUUID() string

func LoadersFromContext

func LoadersFromContext(ctx context.Context) []string

func SliceIndex

func SliceIndex[T any](slice []T, predicate func(e T) bool) int

func ToValue

func ToValue[T any](s T) *T

ToValue returns the memory address of the string.

Types

type ContextKey

type ContextKey string
const (
	PreloadersKey ContextKey = "preloads"
)

type InputMap

type InputMap map[string]interface{}

func ToMap

func ToMap(from interface{}, method ...Method) InputMap

ToMap converts a struct or an object to a map.

func (InputMap) Create

func (i InputMap) Create()

func (InputMap) Update

func (i InputMap) Update()

type Method

type Method string
const (
	MethodCreate Method = "create"
	MethodUpdate Method = "update"
	MethodFilter Method = "filter"
)

Jump to

Keyboard shortcuts

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