Documentation ¶
Index ¶
- func FormatSlice(a []string) string
- func HasDuplicates(resources []string) bool
- func InterfaceSlice(slice interface{}) []interface{}
- func ToPointer(v interface{}) interface{}
- func ToStringSliceE(i interface{}) ([]string, error)
- func TryAcquireMax(ctx context.Context, sem *semaphore.Weighted, n int64) (int64, error)
- func Uint64ToInt(i uint64) int
- func Uint64ToInt64(i uint64) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatSlice ¶
func HasDuplicates ¶
func InterfaceSlice ¶
func InterfaceSlice(slice interface{}) []interface{}
InterfaceSlice converts any interface{} into a []interface{} slice
func ToPointer ¶
func ToPointer(v interface{}) interface{}
ToPointer takes an interface{} object and will return a pointer to this object if the object is not already a pointer. Otherwise, it will return the original value. It is safe to typecast the return-value of GetPointer into a pointer of the right type, except in very special cases (such as passing in nil without an explicit type)
func ToStringSliceE ¶
func TryAcquireMax ¶
SemaphoreAcauireMax is calling TryAcquire with 1 until it fails and return n-TryAcquireSucess
func Uint64ToInt ¶
func Uint64ToInt64 ¶
Uint64ToInt64 if value is bigger than math.MaxInt64 return math.MaxInt64 otherwise returns original value casted to int64
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.