utils

package
v1.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseMap

func ParseMap[T any](object any, out *T) error

func ParseMapKey

func ParseMapKey[T any](object map[string]any, key string, out *T) error

func Unique

func Unique[T comparable](slice []T) []T

Types

type ConcurrentSlice

type ConcurrentSlice[T any] struct {
	// contains filtered or unexported fields
}

func (*ConcurrentSlice[T]) All

func (cs *ConcurrentSlice[T]) All() []T

func (*ConcurrentSlice[T]) Append

func (cs *ConcurrentSlice[T]) Append(item T)

func (*ConcurrentSlice[T]) Clear

func (cs *ConcurrentSlice[T]) Clear()

func (*ConcurrentSlice[T]) Len

func (cs *ConcurrentSlice[T]) Len() int

func (*ConcurrentSlice[T]) Retrieve

func (cs *ConcurrentSlice[T]) Retrieve(size int) []T

type CopyableMap

type CopyableMap map[string]interface{}

func (CopyableMap) DeepCopy

func (m CopyableMap) DeepCopy() map[string]interface{}

DeepCopy will create a deep copy of this map. The depth of this copy is all inclusive. Both maps and slices will be considered when making the copy.

type CopyableSlice

type CopyableSlice []interface{}

func (CopyableSlice) DeepCopy

func (s CopyableSlice) DeepCopy() []interface{}

DeepCopy will create a deep copy of this slice. The depth of this copy is all inclusive. Both maps and slices will be considered when making the copy.

Jump to

Keyboard shortcuts

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