utils

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UidRandomBytesCount = 8
	RADIX               = 16
)
View Source
const (
	MaxSize = 1 << 19
)

Variables

This section is empty.

Functions

func AddBar

func AddBar(p *mpb.Progress, total int64, name string) *mpb.Bar

func BufferedFromJson

func BufferedFromJson[T any](path string, buffer []byte, out *T) error

func CreateGroupId

func CreateGroupId(parentUid string, groupName string) string

func FilterSlice

func FilterSlice[T any](input []T, filterFunc func(T) bool) (output []T)

func FirstInt64NonZero

func FirstInt64NonZero(ints ...int64) int64

func FirstNonEmpty

func FirstNonEmpty(strings ...string) string

func FirstNonZero

func FirstNonZero(ints ...int) int

func FromJson

func FromJson[T any](path string, out *T) error

func GetRandomUid

func GetRandomUid() string

func Hash

func Hash(value string) uint64

func LastIndexFunc

func LastIndexFunc[T any](input []T, filterFunc func(T) bool) int

func MapSlice

func MapSlice[T, U any](input []T, mapper func(T) U) (output []U)

func MapSliceWithPointer

func MapSliceWithPointer[T, U any](input []T, mapper func(*T, ...any) U, args ...any) (output []U)

func ReadFile

func ReadFile[T any](path string, out *T) error

func WriteCsv

func WriteCsv(path string, values [][]string) error

func WriteJson

func WriteJson[T any](path string, value T) error

Types

type ReadFileType

type ReadFileType[T any] func(string, Shared) (*T, error)

type Shared

type Shared map[string]any

type WriteFileType

type WriteFileType[T any] func(string, *T, string, Shared) (string, error)

Jump to

Keyboard shortcuts

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