Documentation ¶
Index ¶
- func Coalesce[T any](v *T, nv T) T
- func CompareLists[T1 any, T2 any](oldList, newList []*T1, getId func(*T1) string, ...) (deleteList []*T1, updateList []*T2, insertList []*T1)
- func FmtFloat(v float64, dec int) string
- func NewPtr[T any](v T) *T
- func NewSlicePtr[T any](v ...T) *[]T
- func NormalizePhone(p string) string
- func PanicRecover(lg logger.WarnAndError, msg string)
- func RequirePageSize(pars dopTypes.ListParams, maxPageSize int64) error
- func SetViperDefaultsFromObj(obj any)
- func SliceExcludeValues[T comparable](sl, vs []T) []T
- func SliceHasValue[T comparable](sl []T, v T) bool
- func SlicesAreSame[T comparable](a, b []T) bool
- func SlicesIntersection[T comparable](sl1, sl2 []T) []T
- func StopSignal() <-chan os.Signal
- func ValidateEmail(v string) bool
- func ValidateIin(v string) bool
- func ValidatePhone(v string) bool
- type WorkerPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareLists ¶
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 NewSlicePtr ¶
func NewSlicePtr[T any](v ...T) *[]T
func NormalizePhone ¶
func PanicRecover ¶
func PanicRecover(lg logger.WarnAndError, msg string)
func RequirePageSize ¶
func RequirePageSize(pars dopTypes.ListParams, maxPageSize int64) error
func SetViperDefaultsFromObj ¶
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 ValidateEmail ¶
func ValidateIin ¶
func ValidatePhone ¶
Types ¶
type WorkerPool ¶
type WorkerPool struct {
// contains filtered or unexported fields
}
func NewWorkerPool ¶
func NewWorkerPool( ctx context.Context, workerCount int, bufferSize int, ) *WorkerPool
func (*WorkerPool) Cancel ¶
func (w *WorkerPool) Cancel(err error)
func (*WorkerPool) Finish ¶
func (w *WorkerPool) Finish()
func (*WorkerPool) FinishAndWait ¶
func (w *WorkerPool) FinishAndWait() error
func (*WorkerPool) GetDuration ¶
func (w *WorkerPool) GetDuration() time.Duration
func (*WorkerPool) Submit ¶
func (w *WorkerPool) Submit(task workerPoolTaskT) bool
func (*WorkerPool) Wait ¶
func (w *WorkerPool) Wait() error
Click to show internal directories.
Click to hide internal directories.