Documentation
¶
Overview ¶
Copyright (C) 2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2025, Lux Industries Inc. All rights reserved. See the file LICENSE for licensing terms.
Index ¶
- func AppendSlices[T any](slices ...[]T) []T
- func Belongs[T comparable](input []T, elem T) bool
- func DirExists(dirName string) bool
- func ExpandHome(path string) string
- func FileExists(filename string) bool
- func GetAPIContext() (context.Context, context.CancelFunc)
- func GetAPILargeContext() (context.Context, context.CancelFunc)
- func GetTimedContext(timeout time.Duration) (context.Context, context.CancelFunc)
- func Map[T, U any](input []T, f func(T) U) []U
- func Retry[T any](fn func() (T, error), maxAttempts int, retryInterval time.Duration) (T, error)
- func RetryWithContextGen[T any](ctxGen func() (context.Context, context.CancelFunc), ...) (T, error)
- func Uint32Sort(arr []uint32)
- func Unique[T comparable](arr []T) []T
- func WrapContext[T any](f func() (T, error)) func(context.Context) (T, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendSlices ¶
func AppendSlices[T any](slices ...[]T) []T
AppendSlices appends multiple slices into a single slice.
func Belongs ¶
func Belongs[T comparable](input []T, elem T) bool
func GetAPIContext ¶
func GetAPIContext() (context.Context, context.CancelFunc)
Context for API requests
func GetAPILargeContext ¶
func GetAPILargeContext() (context.Context, context.CancelFunc)
Context for API requests with large timeout
func GetTimedContext ¶
Timed Context
func Retry ¶
Retry retries the given function until it succeeds or the maximum number of attempts is reached.
func RetryWithContextGen ¶
func RetryWithContextGen[T any]( ctxGen func() (context.Context, context.CancelFunc), fn func(context.Context) (T, error), maxAttempts int, retryInterval time.Duration, ) (T, error)
RetryWithContext retries the given function until it succeeds or the maximum number of attempts is reached. For each retry, it generates a fresh context to be used on the call
func Uint32Sort ¶
func Uint32Sort(arr []uint32)
func Unique ¶
func Unique[T comparable](arr []T) []T
Unique returns a new slice containing only the unique elements from the input slice.
Types ¶
This section is empty.