dopTools

package
v1.1.42 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 18 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Coalesce

func Coalesce[T any](v *T, nv T) T

func CompareLists added in v1.1.39

func CompareLists[T1 any, T2 any](oldList, newList []*T1, getId func(*T1) string, getChanges func(oldItem *T1, newItem *T1) *T2) (deleteList []*T1, updateList []*T2, insertList []*T1)

CompareLists - compares two list and returns lists for: delete, update, insert

func FmtFloat added in v1.0.15

func FmtFloat(v float64, dec int) string

func NewPtr

func NewPtr[T any](v T) *T

func NewSlicePtr

func NewSlicePtr[T any](v ...T) *[]T

func NormalizePhone

func NormalizePhone(p string) string

func PanicRecover added in v1.1.24

func PanicRecover(lg logger.WarnAndError, msg string)

func RequirePageSize

func RequirePageSize(pars dopTypes.ListParams, maxPageSize int64) error

func SetViperDefaultsFromObj added in v1.0.10

func SetViperDefaultsFromObj(obj any)

func SliceExcludeValues

func SliceExcludeValues[T comparable](sl, vs []T) []T

func SliceHasValue

func SliceHasValue[T comparable](sl []T, v T) bool

func SlicesAreSame

func SlicesAreSame[T comparable](a, b []T) bool

func SlicesIntersection

func SlicesIntersection[T comparable](sl1, sl2 []T) []T

func StopSignal

func StopSignal() <-chan os.Signal

func ValidateEmail

func ValidateEmail(v string) bool

func ValidateIin added in v1.0.15

func ValidateIin(v string) bool

func ValidatePhone

func ValidatePhone(v string) bool

Types

type WorkerPool added in v1.1.40

type WorkerPool struct {
	// contains filtered or unexported fields
}

func NewWorkerPool added in v1.1.40

func NewWorkerPool(
	ctx context.Context,
	workerCount int,
	bufferSize int,
) *WorkerPool

func (*WorkerPool) Cancel added in v1.1.40

func (w *WorkerPool) Cancel(err error)

func (*WorkerPool) Finish added in v1.1.40

func (w *WorkerPool) Finish()

func (*WorkerPool) FinishAndWait added in v1.1.40

func (w *WorkerPool) FinishAndWait() error

func (*WorkerPool) GetDuration added in v1.1.40

func (w *WorkerPool) GetDuration() time.Duration

func (*WorkerPool) Submit added in v1.1.40

func (w *WorkerPool) Submit(task workerPoolTaskT) bool

func (*WorkerPool) Wait added in v1.1.40

func (w *WorkerPool) Wait() error

Jump to

Keyboard shortcuts

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