Documentation
¶
Index ¶
- Variables
- func ChannelFnCount[T interface{}](ctx context.Context, fn func(ctx context.Context, ch chan<- T) error) (int, error)
- func ChannelFnList[T interface{}](ctx context.Context, fn func(ctx context.Context, ch chan<- T) error) ([]T, error)
- func ChannelFnMap[T interface{}](ctx context.Context, getFn func(ctx context.Context, ch chan<- T) error, ...) error
- func Compare[T ~string](a, b T) int
- func Contains[T comparable](list []T, value T) bool
- func ContainsAll[T comparable](a []T, b []T) bool
- func Copy[T any](values []T) []T
- func Equal[T comparable](a []T, b []T) bool
- func Exclude[T comparable](list []T, excludes ...T) []T
- func Filter[T any](list []T, match func(value T) bool) []T
- func Find[T any](list []T, match func(value T) bool) (*T, error)
- func Join[T any](a []T, b []T) []T
- func Map[T any](list []T, fn func(value T) error) error
- func Ptr[T any](value T) *T
- func Reverse[T any](values []T) []T
- func UnPtr[T any](ptr *T) T
- func Unique[T comparable](list []T) []T
- type HasEqual
- type HasHashCode
- type Set
- type SetEqual
- type SetHashCode
Constants ¶
This section is empty.
Variables ¶
View Source
var NotFoundError = stderrors.New("not found")
Functions ¶
func ChannelFnCount ¶ added in v1.1.0
func ChannelFnList ¶
func ChannelFnMap ¶
func Contains ¶
func Contains[T comparable](list []T, value T) bool
func ContainsAll ¶ added in v1.2.0
func ContainsAll[T comparable](a []T, b []T) bool
ContainsAll check if all elements of A is in B and all elements of B is in A
func Equal ¶ added in v1.2.0
func Equal[T comparable](a []T, b []T) bool
func Exclude ¶
func Exclude[T comparable](list []T, excludes ...T) []T
func Join ¶ added in v1.7.0
func Join[T any](a []T, b []T) []T
Join allow to join two arrays into one new array
func Unique ¶
func Unique[T comparable](list []T) []T
Types ¶
type HasHashCode ¶ added in v1.3.1
type HasHashCode interface {
HashCode() string
}
type Set ¶ added in v1.3.0
type Set[T comparable] interface { Add(element T) Remove(element T) Contains(element T) bool Slice() []T Length() int }
func NewSet ¶ added in v1.3.0
func NewSet[T comparable]() Set[T]
type SetEqual ¶ added in v1.3.1
type SetEqual[T HasEqual[T]] interface { Add(element T) Remove(element T) Contains(element T) bool Slice() []T Length() int }
func NewSetEqual ¶ added in v1.3.1
type SetHashCode ¶ added in v1.3.1
type SetHashCode[T HasHashCode] interface { Add(element T) Remove(element T) Contains(element T) bool Slice() []T Length() int }
func NewSetHashCode ¶ added in v1.3.1
func NewSetHashCode[T HasHashCode]() SetHashCode[T]
Click to show internal directories.
Click to hide internal directories.