Documentation
¶
Index ¶
- Variables
- func C5[T, S, R, U, V, W any](fn02 func(some V) W, fn01 func(some U) V, fn0 func(some R) U, ...) func(some T) W
- func Compose[T, S, R any](fn1 func(some S) R, fn2 func(some T) S) func(some T) R
- func Concat[T any](left, right []T) []T
- func Contains[T comparable](s []T, e T) bool
- func DictMerge[K comparable, V any](left, right map[K]V) map[K]V
- func Difference[T comparable](from, remove []T) []T
- func Duplicate[T any](x T) []T
- func Fanout[T, R any](fs []func(T) R, item T) []R
- func Filter[T any](list []T, f func(T) bool) []T
- func FilterEmpty[T comparable](l []T) []T
- func Find[T any](list []T, f func(T) bool) *T
- func First[X any](list []X) *X
- func Flatmap[T, R any](fn func(some T) []R, list []T) []R
- func Flip[X, Y, Z any](fn func(X, Y) Z) func(Y, X) Z
- func Fmap[T, 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 GetRequestWithContext(ctx context.Context, url string) (*http.Response, error)
- func ID[T any](x T) T
- func Keys[T comparable, R any](dict map[T]R) []T
- func ListContains[K comparable](list []K, item K) bool
- func ListHas[K any](list []K, has func(l K) bool) bool
- func P2[X, Y, Z any](fn func(X, Y) Z, x X) func(Y) Z
- func S[T any](fns ...func(some T) T) func(some T) T
- func SortBy[T any](sortFn func(T, T) bool, list []T) []T
- func ToDict[T comparable](xs []T) map[T]bool
- func Uniq[T comparable](xs []T) []T
- type AsyncResult
- type ContextKey
- type CopierConverter
- type CopierConverters
- type CopyConverter
- type DoOption
- type MapKeyVal
- type Params
- type Result
- type Runnable
- type TimeoutOptions
Constants ¶
This section is empty.
Variables ¶
View Source
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 )
View Source
var DefaultConverters = CopierConverters{
timeToPBTimeStamp,
timePtrToPBTimeStamp,
pbTimeStampToTime,
pbTimeStampToTimePtr,
}
Functions ¶
func C5 ¶ added in v0.6.53
func C5[T, S, R, U, V, W any](fn02 func(some V) W, fn01 func(some U) V, fn0 func(some R) U, fn1 func(some S) R, fn2 func(some T) S) func(some T) W
func Compose ¶ added in v0.6.53
func Compose[T, S, R any](fn1 func(some S) R, fn2 func(some T) S) func(some T) R
func Contains ¶ added in v0.6.74
func Contains[T comparable](s []T, e T) bool
func DictMerge ¶
func DictMerge[K comparable, V any](left, right map[K]V) map[K]V
func Difference ¶
func Difference[T comparable](from, remove []T) []T
func FilterEmpty ¶ added in v0.6.74
func FilterEmpty[T comparable](l []T) []T
func Flatmap ¶
func Flatmap[T, R any](fn func(some T) []R, list []T) []R
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 GetRequestWithContext ¶ added in v0.6.270
getWithContext creates and sends an HTTP GET request with the provided context
func Keys ¶ added in v0.6.53
func Keys[T comparable, R any](dict map[T]R) []T
func ListContains ¶ added in v0.6.124
func ListContains[K comparable](list []K, item K) bool
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 ToDict ¶
func ToDict[T comparable](xs []T) map[T]bool
func Uniq ¶
func Uniq[T comparable](xs []T) []T
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 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
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 MapKeyVal ¶ added in v0.6.288
type MapKeyVal[K comparable, V any] struct { Key K Value V }
type TimeoutOptions ¶ added in v0.6.288
Click to show internal directories.
Click to hide internal directories.