Documentation ¶
Index ¶
- Variables
- func Accumulate[A any, T any](items []T, accumulator func(A, T) A) A
- func AccumulateE[A any, T any](items []T, accumulator func(A, T) (A, error)) (A, error)
- func AccumulateMap[A any, K comparable, V any](m map[K]V, accumulator func(A, K, V) A) A
- func Any[T any](f func(T) bool, list []T)
- func C[T any](fns ...func(some T) T) func(some T) T
- func C2[T any, S any, R any](fn1 func(some S) R, fn2 func(some T) S) func(some T) R
- func C3[T any, S any, R any, U any](fn0 func(some R) U, fn1 func(some S) R, fn2 func(some T) S) func(some T) U
- func C4[T any, S any, R any, U any, V any](fn01 func(some U) V, fn0 func(some R) U, fn1 func(some S) R, ...) func(some T) V
- func C5[T any, S any, R any, U any, V any, W any](fn02 func(some V) W, fn01 func(some U) V, fn0 func(some R) U, ...) func(some T) W
- func Chunk[T any](list []T, chunkSize int) [][]T
- func CloneList[T any](l []T) []T
- func CloneMap[T any, K comparable](m map[K]T) map[K]T
- func Compose[T any, S any, R any](fn1 func(some S) R, fn2 func(some T) S) func(some T) R
- func Concat[T any](left []T, right []T) []T
- func Cons[X any](x X, list []X) []X
- func Contains[T comparable](s []T, e T) bool
- func ContainsAny(s string, subs ...string) bool
- func ContainsDuplicatesErr[T comparable](list []T) error
- func ContextWithIdempotencyKey(ctx context.Context, idempotencyKey string) context.Context
- func CopyPtrVal[T any](t *T) (*T, error)
- func CopyVal[T any](t T) (T, error)
- func DecodeBase64OrValue(s string) (string, error)
- func Deduplicate[T comparable](list []T) []T
- func DeepEqual[T any](i T, l T) bool
- func DefaultPtr[T any](value *T, defaultValue T) T
- func DefaultPtrOrValue[T any](value *T, defaultValue T) T
- func DefaultValue[T any](value T, defaultValue T) T
- func Deref[T any](x *T) T
- func DictMerge[K comparable, V any](left map[K]V, right map[K]V) map[K]V
- func Difference[T comparable](from []T, remove []T) []T
- func DistinctChan[T any, K comparable](keyGetter func(T any) K, bufSize int) (input chan T, output chan T)
- func DoAfterE(ctx context.Context, d time.Duration, f func() error, ...) error
- func DoForever(ctx context.Context, f func())
- func DoForeverE(ctx context.Context, f func() error, done func(context.Context) error) error
- func DoOnDuration(ctx context.Context, d time.Duration, f func())
- func DoOnDurationE(ctx context.Context, d time.Duration, f func() error, ...) error
- func DoWithTimeout(fn func(ctx context.Context) error, timeout time.Duration, ...) error
- func DoWithTimeoutData[T any](fn func(ctx context.Context) (T, error), timeout time.Duration, ...) (T, error)
- func Duplicate[T any](x T) []T
- func Enconcat[X any](before []X, x X, after []X) []X
- func Except[T comparable](items []T, except []T) []T
- func Fanout[T any, R any](fs []func(T) R, item T) []R
- func Filter[T any](list []T, f func(T) bool) []T
- func FilterE[T any](list []T, f func(T) (bool, error)) ([]T, error)
- func FilterEmpty[T comparable](l []T) []T
- func FilterOutEmpty[T any](list []T) []T
- func Find[T any](list []T, f func(T) bool) *T
- func FindPtr[T any](list []*T, f func(*T) bool) *T
- func First[X any](list []X) *X
- func Flatmap[T any, R any](fn func(some T) []R, list []T) []R
- func FlatmapE[T any, R any](fn func(some T) ([]R, error), list []T) ([]R, error)
- func Flatten[T any](listOfLists [][]T) []T
- func Flip[X any, Y any, Z any](fn func(X, Y) Z) func(Y, X) Z
- func Fmap[T any, R any](fn func(some T) R, list []T) []R
- func Foldl[T any, R any](fn func(acc R, next T) R, base R, list []T) R
- func FoldlE[T any, R any](fn func(acc R, next T) (R, error), base R, list []T) (R, error)
- func Foldr[T any, R any](fn func(next T, carry R) R, base R, list []T) R
- func FromJSON[T any](j []byte) (T, error)
- func GetAValueFromMap[K comparable, V any](m map[K]V) *V
- func GetFieldName(structPtr any, fieldPtr any) string
- func GetFirstKeyThatContainsNoCase[T any](m map[string]T, s string) string
- func GetFunctionName(i any) string
- func GetIdempotencyKeyFromContext(ctx context.Context) string
- func GetMapKeys[K comparable, V any](m map[K]V) []K
- func GetMapValues[K comparable, V any](m map[K]V) []V
- func GetRequestWithContext(ctx context.Context, url string) (*http.Response, error)
- func GroupBy[K comparable, A any](list []A, keyGetter func(A) K) map[K][]A
- func GroupByE[T comparable, A any](list []A, f func(A) (T, error)) (map[T][]A, error)
- func ID[T any](x T) T
- func InitialNotEqual[T any](i T) func(l T) bool
- func IsEmpty[T any](x T) bool
- func IsEmptyValP[T any](x *T) bool
- func Iterate[T any](hasNext func() bool, next func() (T, error), do func(a T) (bool, error)) error
- func IterateToSlice[T any](f func() (bool, T, error)) ([]T, error)
- func Keys[T comparable, R any](dict map[T]R) []T
- func LastXChars(s string, x int) string
- func ListAnyDiff[T any, C comparable](a []T, b []T, toComp func(t T) C) []T
- func ListContains[K comparable](list []K, item K) bool
- func ListDiff[T comparable](a []T, b []T) []T
- func ListHas[K any](list []K, has func(l K) bool) bool
- func ListItemsAreErr[T comparable](items []T, are []T) error
- func ListOfPointersToListOfValues[T any](list []*T) []T
- func ListOfSomethingToListOfAny[T any](l []T) []any
- func ListToChannel[T any](l []T) chan T
- func ListToCollisionMap[T comparable](list []T) map[T]bool
- func ListToMap[T any, R comparable](list []T, keySelector func(l T) R) map[R]T
- func ListToMapE[T any, R comparable](list []T, keySelector func(l T) (R, error)) (map[R]T, error)
- func ListToMapKV[T any, R comparable, V any](list []T, keySelector func(l T) R, valueSelector func(l T) V) map[R]V
- func MakePrefixIdempotencyKeyFromCtx(ctx context.Context, prefix string) string
- func ManyIntegersToInts[T constraints.Integer](i []T) []int
- func ManyStringLikeToStrings[T ~string](i []T) []string
- func Map[T, R any](items []T, mapper func(T) R) []R
- func MapContainsKey[K comparable, V any](m map[K]V, key K) bool
- func MapDiff[K comparable, V1 any, V2 any](a map[K]V1, b map[K]V2) map[K]V1
- func MapE[T, R any](items []T, mapper func(T) (R, error)) ([]R, error)
- func MapFromList[T any, R comparable](list []T, keySelector func(l T) R) map[R]T
- func MapHasKey[K comparable, V any](m map[K]V, key K) bool
- func MapMap[K comparable, V any, R any](m map[K]V, f func(K, V) R) []R
- func MapMapE[K comparable, V any, R any](m map[K]V, f func(K, V) (R, error)) ([]R, error)
- func MapMapMerge[K1 comparable, V1 any, K2 comparable, V2 any](m map[K1]V1, f func(K1, V1) map[K2]V2) map[K2]V2
- func MapToGenericMap[v any](m map[string]v) map[string]interface{}
- func MapToStruct[T any](m any) (T, error)
- func Max[T constraints.Ordered](x T, y T) T
- func MergeMaps[K comparable, V any](maps ...map[K]V) map[K]V
- func Min[T constraints.Ordered](x T, y T) T
- func MultiGroupBy[T comparable, A any](list []A, f func(A) []T) map[T][]A
- func OnTick(ctx context.Context, d time.Duration, f func()) *time.Ticker
- func P2[X any, Y any, Z any](fn func(X, Y) Z, x X) func(Y) Z
- func ParallelMapE[T, R any](items []T, mapper func(T) (R, error)) ([]R, error)
- func ParallelWorkerMapE[T, R any](items []T, mapper func(T) (R, error), maxWorkers int) ([]R, error)
- func ParallelWorkerMapExitOnE[T, R any](ctx context.Context, items []T, mapper func(context.Context, T) (R, error), ...) ([]R, error)
- func ProtoToFormattedString(m proto.Message) string
- func Ptr[T any](x T) *T
- func RemoveDuplicates[T comparable](list []T) []T
- func RetryTest(t *testing.T, testFunc func(t *testing.T), numRetries int)
- func RetryWithAttemptCount(o backoff.Operation, b backoff.BackOff) error
- func RetryWithDataAndAttemptCount[T any](o backoff.OperationWithData[T], b backoff.BackOff) (T, error)
- func ReturnOnCondition[T any](ctx context.Context, fetcher func(ctx context.Context) (T, error), ...) (T, error)
- func ReverseList[T any](list []T)
- func RoundToNearestBase(num float64, base float64) float64
- func RoundToNearestDecimal(num float64, decimalPlaces int) float64
- func Run[T any](l []T, f func(t T))
- func RunAllWithShutdown(ctx context.Context, runners []Runnable, shutdownChan <-chan any) error
- func S[T any](fns ...func(some T) T) func(some T) T
- func SleepWithHealthCheck(d time.Duration, tickRate time.Duration, heartbeatFn func())
- func SortBy[T any](sortFn func(T, T) bool, list []T) []T
- func SortByE[T any](sortFn func(T, T) (bool, error), list []T) ([]T, error)
- func SortEachBucket[T comparable, A any](bucketedMap map[T][]A, f func(a A, b A) bool) map[T][]A
- func ToDict[T comparable](xs []T) map[T]bool
- func ToJSONString(i any) string
- func TryCopyTo[T any, R any](t T, r R) (R, error)
- func TryCopyToNew[T any, R any](t T, options ...CopyOption) (R, error)
- func TryCopyToNewE[T any, R any](t T, mappers ...CopyMappingFunc[T, R]) (R, error)
- func TryCopyToNewOptions[T any, R any](t T, options CopyOptions) (R, error)
- func TryCopyToOptions[T any, R any](t T, r R, options CopyOptions) (R, error)
- func Uniq[T comparable](xs []T) []T
- func ValueOrZero[T any](ptr *T) T
- func ZeroValueToNil[T any](x T) *T
- type AsyncResult
- type BufferedObjects
- type ContextKey
- type CopierConverter
- type CopierConverters
- type CopyConverter
- type CopyMap
- type CopyMapper
- type CopyMappers
- type CopyMapping
- type CopyMappingFunc
- type CopyOption
- type CopyOptions
- type DoOption
- type DumbCopyMapper
- type MapKeyVal
- type Params
- type Result
- type Rollback
- type Runnable
- type SafeCounter
- type SafeMap
- func (m *SafeMap[K, V]) Clear()
- func (m *SafeMap[K, V]) Copy() *SafeMap[K, V]
- func (m *SafeMap[K, V]) CopyMap(c *SafeMap[K, V]) *SafeMap[K, V]
- func (m *SafeMap[K, V]) Delete(key K)
- func (m *SafeMap[K, V]) Get(key K) (V, bool)
- func (m *SafeMap[K, V]) Keys() []K
- func (m *SafeMap[K, V]) Len() int
- func (m *SafeMap[K, V]) Override(s map[K]V)
- func (m *SafeMap[K, V]) Set(key K, value V)
- func (m *SafeMap[K, V]) Values() []V
- type SafeSet
- type SafeSlice
- type SafeValue
- type TimeoutOptions
- type UniqueBufferedObjects
Constants ¶
This section is empty.
Variables ¶
var ( // ErrCanceled is the error returned when the context is canceled. ErrCanceled = context.Canceled // ErrTimeout is the error returned when the context's deadline passes. ErrTimeout = context.DeadlineExceeded )
var DefaultConverters = CopierConverters{
timeToPBTimeStamp,
timePtrToPBTimeStamp,
pbTimeStampToTime,
pbTimeStampToTimePtr,
}
Functions ¶
func Accumulate ¶ added in v0.6.124
func AccumulateE ¶ added in v0.6.124
func AccumulateMap ¶ added in v0.6.288
func AccumulateMap[A any, K comparable, V any](m map[K]V, accumulator func(A, K, V) A) A
func CloneMap ¶ added in v0.6.288
func CloneMap[T any, K comparable](m map[K]T) map[K]T
func Contains ¶ added in v0.6.74
func Contains[T comparable](s []T, e T) bool
func ContainsAny ¶ added in v0.6.288
func ContainsDuplicatesErr ¶ added in v0.6.124
func ContainsDuplicatesErr[T comparable](list []T) error
func ContextWithIdempotencyKey ¶ added in v0.6.288
func CopyPtrVal ¶ added in v0.6.288
func DecodeBase64OrValue ¶ added in v0.6.288
func Deduplicate ¶ added in v0.6.288
func Deduplicate[T comparable](list []T) []T
func DefaultPtr ¶ added in v0.6.124
func DefaultPtr[T any](value *T, defaultValue T) T
func DefaultPtrOrValue ¶ added in v0.6.124
func DefaultPtrOrValue[T any](value *T, defaultValue T) T
return default if ptr is nil or de-referenced ptr value is empty
func DefaultValue ¶ added in v0.6.124
func DefaultValue[T any](value T, defaultValue T) T
func DictMerge ¶
func DictMerge[K comparable, V any](left map[K]V, right map[K]V) map[K]V
func Difference ¶
func Difference[T comparable](from []T, remove []T) []T
func DistinctChan ¶ added in v0.6.288
func DistinctChan[T any, K comparable]( keyGetter func(T any) K, bufSize int, ) (input chan T, output chan T)
func DoForeverE ¶ added in v0.6.288
func DoOnDuration ¶ added in v0.6.288
cancel context to end
func DoOnDurationE ¶ added in v0.6.288
func DoOnDurationE(ctx context.Context, d time.Duration, f func() error, done func(context.Context) error, ) error
end early if err
func DoWithTimeout ¶ added in v0.6.288
func DoWithTimeout(fn func(ctx context.Context) error, timeout time.Duration, opts ...TimeoutOptions) error
if you loop forever, make sure you have a way to break the loop see Test_DoWithTimeoutTimeoutLoop
func DoWithTimeoutData ¶ added in v0.6.288
func DoWithTimeoutData[T any](fn func(ctx context.Context) (T, error), timeout time.Duration, opts ...TimeoutOptions) (T, error)
if you loop forever, make sure you have a way to break the loop see Test_DoWithTimeoutTimeoutLoop
func Except ¶ added in v0.6.288
func Except[T comparable](items []T, except []T) []T
Await blocks until the asynchronous operation completes, returning the result and error.
func FilterEmpty ¶ added in v0.6.74
func FilterEmpty[T comparable](l []T) []T
func FilterOutEmpty ¶ added in v0.6.288
func FilterOutEmpty[T any](list []T) []T
func Flatmap ¶
Take a list of things and a function that returns a list of things then combines list after mapping func T -> [R, R, R ...] [T, T, T ...] -> [R, R, R ...]
func FlatmapE ¶ added in v0.6.124
Take a list of things and a function that returns a list of things then combines list after mapping (return early from error) func T -> [R, R, R ...] [T, T, T ...] -> [R, R, R ...]
func GetAValueFromMap ¶ added in v0.6.124
func GetAValueFromMap[K comparable, V any](m map[K]V) *V
func GetFieldName ¶ added in v0.6.288
func GetFirstKeyThatContainsNoCase ¶ added in v0.6.288
func GetFunctionName ¶ added in v0.6.288
func GetIdempotencyKeyFromContext ¶ added in v0.6.288
func GetMapKeys ¶ added in v0.6.124
func GetMapKeys[K comparable, V any](m map[K]V) []K
func GetMapValues ¶ added in v0.6.124
func GetMapValues[K comparable, V any](m map[K]V) []V
func GetRequestWithContext ¶ added in v0.6.270
getWithContext creates and sends an HTTP GET request with the provided context
func GroupBy ¶ added in v0.6.288
func GroupBy[K comparable, A any](list []A, keyGetter func(A) K) map[K][]A
func GroupByE ¶ added in v0.6.288
func GroupByE[T comparable, A any](list []A, f func(A) (T, error)) (map[T][]A, error)
func InitialNotEqual ¶ added in v0.6.124
func IsEmptyValP ¶ added in v0.6.124
func IterateToSlice ¶ added in v0.6.288
Assumes that if cont is false res is empty
func Keys ¶ added in v0.6.53
func Keys[T comparable, R any](dict map[T]R) []T
func LastXChars ¶ added in v0.6.288
func ListAnyDiff ¶ added in v0.6.288
func ListAnyDiff[T any, C comparable](a []T, b []T, toComp func(t T) C) []T
func ListContains ¶ added in v0.6.124
func ListContains[K comparable](list []K, item K) bool
func ListDiff ¶ added in v0.6.288
func ListDiff[T comparable](a []T, b []T) []T
func ListItemsAreErr ¶ added in v0.6.124
func ListItemsAreErr[T comparable](items []T, are []T) error
takes a list of items and checks if items are elements in another list
func ListOfPointersToListOfValues ¶ added in v0.6.124
func ListOfPointersToListOfValues[T any](list []*T) []T
func ListOfSomethingToListOfAny ¶ added in v0.6.124
func ListToChannel ¶ added in v0.6.288
func ListToChannel[T any](l []T) chan T
func ListToCollisionMap ¶ added in v0.6.288
func ListToCollisionMap[T comparable](list []T) map[T]bool
func ListToMap ¶ added in v0.6.288
func ListToMap[T any, R comparable](list []T, keySelector func(l T) R) map[R]T
func ListToMapE ¶ added in v0.6.288
func ListToMapE[T any, R comparable](list []T, keySelector func(l T) (R, error)) (map[R]T, error)
func ListToMapKV ¶ added in v0.6.288
func ListToMapKV[T any, R comparable, V any](list []T, keySelector func(l T) R, valueSelector func(l T) V) map[R]V
func MakePrefixIdempotencyKeyFromCtx ¶ added in v0.6.288
func ManyIntegersToInts ¶ added in v0.6.124
func ManyIntegersToInts[T constraints.Integer](i []T) []int
func ManyStringLikeToStrings ¶ added in v0.6.124
func Map ¶ added in v0.6.124
func Map[T, R any](items []T, mapper func(T) R) []R
func T -> R [T, T, T ...] -> [R, R, R ...]
func MapContainsKey ¶ added in v0.6.111
func MapContainsKey[K comparable, V any](m map[K]V, key K) bool
func MapDiff ¶ added in v0.6.288
func MapDiff[K comparable, V1 any, V2 any](a map[K]V1, b map[K]V2) map[K]V1
creates a map of the keys in a and not in b
func MapFromList ¶ added in v0.6.124
func MapFromList[T any, R comparable](list []T, keySelector func(l T) R) map[R]T
func MapHasKey ¶ added in v0.6.288
func MapHasKey[K comparable, V any](m map[K]V, key K) bool
func MapMap ¶ added in v0.6.288
func MapMap[K comparable, V any, R any](m map[K]V, f func(K, V) R) []R
map over a go map
func MapMapE ¶ added in v0.6.288
func MapMapE[K comparable, V any, R any](m map[K]V, f func(K, V) (R, error)) ([]R, error)
func MapMapMerge ¶ added in v0.6.288
func MapMapMerge[K1 comparable, V1 any, K2 comparable, V2 any](m map[K1]V1, f func(K1, V1) map[K2]V2) map[K2]V2
map over a go map and return a map, merge the maps
func MapToGenericMap ¶ added in v0.6.288
func MapToStruct ¶ added in v0.6.124
pass in m a map of string to any
func Max ¶ added in v0.6.288
func Max[T constraints.Ordered](x T, y T) T
func MergeMaps ¶ added in v0.6.124
func MergeMaps[K comparable, V any](maps ...map[K]V) map[K]V
right maps override left if they have the same key
func Min ¶ added in v0.6.288
func Min[T constraints.Ordered](x T, y T) T
func MultiGroupBy ¶ added in v0.6.288
func MultiGroupBy[T comparable, A any](list []A, f func(A) []T) map[T][]A
func ParallelMapE ¶ added in v0.6.288
func ParallelWorkerMapE ¶ added in v0.6.288
func ParallelWorkerMapExitOnE ¶ added in v0.6.288
func ParallelWorkerMapExitOnE[T, R any](ctx context.Context, items []T, mapper func(context.Context, T) (R, error), maxWorkers int) ([]R, error)
Early returns if one error is found, will return partial work
func ProtoToFormattedString ¶ added in v0.6.288
for testing, and printing to screen, ignores error
func RemoveDuplicates ¶ added in v0.6.124
func RemoveDuplicates[T comparable](list []T) []T
func RetryWithAttemptCount ¶ added in v0.6.288
func RetryWithAttemptCount(o backoff.Operation, b backoff.BackOff) error
func RetryWithDataAndAttemptCount ¶ added in v0.6.288
func ReturnOnCondition ¶ added in v0.6.124
func ReverseList ¶ added in v0.6.288
func ReverseList[T any](list []T)
func RoundToNearestBase ¶ added in v0.6.288
func RoundToNearestDecimal ¶ added in v0.6.288
func RunAllWithShutdown ¶ added in v0.6.288
RunAllWithShutdown runs Runnabls in parallel and waits for shutdown signal (max n seconds) if one runner errors or panics
func SleepWithHealthCheck ¶ added in v0.6.288
SleepWithHealthCheck sleeps for the specified duration `d` and periodically calls `heartbeatFn` at every `tickRate` until `d` has elapsed.
func SortBy ¶ added in v0.6.53
sortFn if i < j then ascending (1,2,3), if i > j then descending (3,2,1)
func SortByE ¶ added in v0.6.288
sortFn if i < j then ascending (1,2,3), if i > j then descending (3,2,1)
func SortEachBucket ¶ added in v0.6.288
func SortEachBucket[T comparable, A any](bucketedMap map[T][]A, f func(a A, b A) bool) map[T][]A
func ToDict ¶
func ToDict[T comparable](xs []T) map[T]bool
func ToJSONString ¶ added in v0.6.288
returns json string or empty if fails
func TryCopyToNew ¶ added in v0.6.124
func TryCopyToNew[T any, R any](t T, options ...CopyOption) (R, error)
func TryCopyToNewE ¶ added in v0.6.288
func TryCopyToNewE[T any, R any](t T, mappers ...CopyMappingFunc[T, R]) (R, error)
For testing different DX
func TryCopyToNewOptions ¶ added in v0.6.288
func TryCopyToNewOptions[T any, R any](t T, options CopyOptions) (R, error)
func TryCopyToOptions ¶ added in v0.6.288
func TryCopyToOptions[T any, R any](t T, r R, options CopyOptions) (R, error)
func Uniq ¶
func Uniq[T comparable](xs []T) []T
func ValueOrZero ¶ added in v0.6.124
func ValueOrZero[T any](ptr *T) T
func ZeroValueToNil ¶ added in v0.6.124
func ZeroValueToNil[T any](x T) *T
return value or nil if value is zero
Types ¶
type AsyncResult ¶ added in v0.6.280
type AsyncResult[T any] struct { // contains filtered or unexported fields }
func Async ¶ added in v0.6.280
func Async[T any](f func() (T, error)) *AsyncResult[T]
func (*AsyncResult[T]) Await ¶ added in v0.6.280
func (ar *AsyncResult[T]) Await() (T, error)
Await blocks until the asynchronous operation completes, returning the result and error.
type BufferedObjects ¶ added in v0.6.288
type BufferedObjects[T any] struct { // contains filtered or unexported fields }
func NewBufferedObjects ¶ added in v0.6.288
func NewBufferedObjects[T any](flushSize int, flushInterval time.Duration, flushHandler func([]T)) *BufferedObjects[T]
func (*BufferedObjects[T]) Add ¶ added in v0.6.288
func (bi *BufferedObjects[T]) Add(object T)
func (*BufferedObjects[T]) Flush ¶ added in v0.6.288
func (bi *BufferedObjects[T]) Flush()
func (*BufferedObjects[T]) SetBufferSize ¶ added in v0.6.288
func (bi *BufferedObjects[T]) SetBufferSize(flushSize int)
func (*BufferedObjects[T]) Stop ¶ added in v0.6.288
func (bi *BufferedObjects[T]) Stop()
func (*BufferedObjects[T]) WaitTillEmpty ¶ added in v0.6.288
func (bi *BufferedObjects[T]) WaitTillEmpty()
type ContextKey ¶ added in v0.6.288
type ContextKey string
const IdempotencyKeyName ContextKey = "idempotencyKey"
type CopierConverter ¶ added in v0.6.288
type CopierConverter interface {
ToCopierTypeConverter() copier.TypeConverter
}
type CopierConverters ¶ added in v0.6.288
type CopierConverters []CopierConverter
func (CopierConverters) ToCopierTypeConverters ¶ added in v0.6.288
func (c CopierConverters) ToCopierTypeConverters() []copier.TypeConverter
type CopyConverter ¶ added in v0.6.288
func (CopyConverter[T, R]) ToCopierTypeConverter ¶ added in v0.6.288
func (c CopyConverter[T, R]) ToCopierTypeConverter() copier.TypeConverter
type CopyMapper ¶ added in v0.6.288
type CopyMapper interface {
ToCopierMapping() copier.FieldNameMapping
}
type CopyMappers ¶ added in v0.6.288
type CopyMappers []CopyMapper
func (CopyMappers) ToCopierMappings ¶ added in v0.6.288
func (c CopyMappers) ToCopierMappings() []copier.FieldNameMapping
type CopyMapping ¶ added in v0.6.288
func (CopyMapping[T, R]) ToCopierMapping ¶ added in v0.6.288
func (c CopyMapping[T, R]) ToCopierMapping() copier.FieldNameMapping
type CopyMappingFunc ¶ added in v0.6.288
func (CopyMappingFunc[T, R]) ToCopierMapping ¶ added in v0.6.288
func (c CopyMappingFunc[T, R]) ToCopierMapping() copier.FieldNameMapping
Doesn't work but leaving for future reference
type CopyOption ¶ added in v0.6.288
type CopyOption interface {
// contains filtered or unexported methods
}
type CopyOptions ¶ added in v0.6.288
type CopyOptions struct { ShallowCopy bool OmitDefaultConverters bool Converters CopierConverters Mappers CopyMappers // create mappings for any arbitrary type }
func (CopyOptions) ToCopierOptions ¶ added in v0.6.288
func (c CopyOptions) ToCopierOptions() copier.Option
type DoOption ¶ added in v0.6.288
DoOption defines the method to customize a DoWithTimeout call.
func WithContext ¶ added in v0.6.288
WithContext customizes a DoWithTimeout call with given ctx.
type DumbCopyMapper ¶ added in v0.6.288
type DumbCopyMapper struct {
Mapping copier.FieldNameMapping
}
func (DumbCopyMapper) ToCopierMapping ¶ added in v0.6.288
func (d DumbCopyMapper) ToCopierMapping() copier.FieldNameMapping
type MapKeyVal ¶ added in v0.6.288
type MapKeyVal[K comparable, V any] struct { Key K Value V }
func MapToList ¶ added in v0.6.288
func MapToList[K comparable, T any](m map[K]T) []MapKeyVal[K, T]
type Rollback ¶ added in v0.6.288
type Rollback struct {
// contains filtered or unexported fields
}
func NewRollback ¶ added in v0.6.288
type SafeCounter ¶ added in v0.6.288
type SafeCounter struct {
// contains filtered or unexported fields
}
func NewSafeCounter ¶ added in v0.6.288
func NewSafeCounter() *SafeCounter
func (*SafeCounter) Dec ¶ added in v0.6.288
func (c *SafeCounter) Dec()
func (*SafeCounter) Get ¶ added in v0.6.288
func (c *SafeCounter) Get() int
func (*SafeCounter) Inc ¶ added in v0.6.288
func (c *SafeCounter) Inc()
type SafeMap ¶ added in v0.6.288
type SafeMap[K comparable, V any] struct { // contains filtered or unexported fields }
SafeMap is a generic map guarded by a RW mutex.
func NewSafeMap ¶ added in v0.6.288
func NewSafeMap[K comparable, V any]() *SafeMap[K, V]
NewSafeMap creates a new SafeMap.
func (*SafeMap[K, V]) Clear ¶ added in v0.6.288
func (m *SafeMap[K, V]) Clear()
Clear removes all entries from the map.
func (*SafeMap[K, V]) Copy ¶ added in v0.6.288
Copy creates a new SafeMap with the same key-value pairs.
func (*SafeMap[K, V]) CopyMap ¶ added in v0.6.288
Sets the pointer of the current map to a copy of the map passed in.
func (*SafeMap[K, V]) Delete ¶ added in v0.6.288
func (m *SafeMap[K, V]) Delete(key K)
Delete removes a key from the map.
type SafeSet ¶ added in v0.6.288
type SafeSet[K comparable] struct { // contains filtered or unexported fields }
func NewSafeSet ¶ added in v0.6.288
func NewSafeSet[K comparable]() *SafeSet[K]
func SliceToSafeSet ¶ added in v0.6.288
func SliceToSafeSet[T comparable](s []T) *SafeSet[T]
type SafeSlice ¶ added in v0.6.288
type SafeSlice[T any] struct { // contains filtered or unexported fields }
func NewSafeSlice ¶ added in v0.6.288
func (*SafeSlice[T]) Append ¶ added in v0.6.288
func (s *SafeSlice[T]) Append(value ...T)
Append adds a new element to the slice.
type SafeValue ¶ added in v0.6.288
type SafeValue[T any] struct { // contains filtered or unexported fields }
SafeValue holds an arbitrary value with read and write protection. T is the type of the value.
func NewSafeValue ¶ added in v0.6.288
NewSafeValue creates a new SafeValue.
type TimeoutOptions ¶ added in v0.6.288
type UniqueBufferedObjects ¶ added in v0.6.288
type UniqueBufferedObjects[T any] struct { // contains filtered or unexported fields }
func NewUniqueBufferedObjects ¶ added in v0.6.288
func (*UniqueBufferedObjects[T]) Add ¶ added in v0.6.288
func (bi *UniqueBufferedObjects[T]) Add(object T)
func (*UniqueBufferedObjects[T]) Flush ¶ added in v0.6.288
func (bi *UniqueBufferedObjects[T]) Flush()
func (*UniqueBufferedObjects[T]) Stop ¶ added in v0.6.288
func (bi *UniqueBufferedObjects[T]) Stop()
func (*UniqueBufferedObjects[T]) WaitTillEmpty ¶ added in v0.6.288
func (bi *UniqueBufferedObjects[T]) WaitTillEmpty()