utils

package
v0.0.0-...-62da268 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Some useful logical operation for data processing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(bs ...func() bool) (int, bool)

func Chain

func Chain(
	fnList ...func() error,
) error

func ChainWithoutWrapper

func ChainWithoutWrapper(
	fnList ...func() error,
) error

ChainWithoutWrapper Return error instead of a wrapper.

func Diff

func Diff[T any, K comparable](list1 []T, list2 []T, Key func(item T) K) (noInList1, noInList2 []T)

func Go

func Go(fn func())

func GoWithAction

func GoWithAction(fn func(), panicAction func(r interface{}))

func Max

func Max[T constraints.Ordered](a, b T) T

func NowInMs

func NowInMs() uint64

func NowInSec

func NowInSec() uint64

func PanicIf

func PanicIf(err error)

func Retry

func Retry(
	maxRetry uint,
	timeWait time.Duration,
	action func() error,
	errHint string,
) error

func StrOrDefault

func StrOrDefault(str string, other string) string

Types

type ChainError

type ChainError struct {
	FnIndex uint
	Err     error
}

func (*ChainError) Error

func (ce *ChainError) Error() string

type Default

type Default interface {
	constraints.Ordered
}

Jump to

Keyboard shortcuts

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