funcs

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryFunction added in v0.1.12

type BinaryFunction[T, R, U any] func(T, R) U

BinaryFunction 将两个类型转为第三个类型

type BinaryKVFunction added in v0.1.12

type BinaryKVFunction[K, V, R, U any] func(K, V, R) U

type BinaryKVFunction2 added in v0.1.12

type BinaryKVFunction2[K, V, RK, RV, UK, UV any] func(K, V, RK, RV) (UK, UV)

type BinaryKVOperator added in v0.1.12

type BinaryKVOperator[K, V any] func(K, V, K, V) (K, V)

type BinaryOperator added in v0.1.12

type BinaryOperator[T any] func(T, T) T

BinaryOperator 输入两个相同类型的参数,对其做二元运算,返回相同类型的结果

type Comparator added in v0.1.12

type Comparator[T any] func(T, T) int

Comparator 比较两个元素. 第一个元素大于第二个元素时,返回正数; 第一个元素小于第二个元素时,返回负数; 否则返回 0.

type ComparatorKV added in v0.1.12

type ComparatorKV[K, V any] func(K, V, K, V) int

Comparator 比较两个元素. 第一个元素大于第二个元素时,返回正数; 第一个元素小于第二个元素时,返回负数; 否则返回 0.

type Consumer added in v0.1.12

type Consumer[T any] func(T)

Consumer 消费一个元素

type ConsumerKV added in v0.1.12

type ConsumerKV[K, V any] func(K, V)

ConsumerKV 消费一个KV

type Func

type Func func()

type FuncRetry added in v0.3.0

type FuncRetry func(times uint) (retry bool)

func (FuncRetry) Do added in v0.3.0

func (f FuncRetry) Do(times uint) (retry bool)

type FuncReturnDataOrErr added in v0.3.0

type FuncReturnDataOrErr[T any] func() (T, error)

type FuncReturnErr added in v0.3.0

type FuncReturnErr func() error

type GrpcServiceMethod

type GrpcServiceMethod[REQ, RES any] func(context.Context, REQ) (RES, error)

type Less added in v0.1.12

type Less[T any] func(T, T) bool

type LessKV added in v0.1.12

type LessKV[K, V any] func(K, V, K, V) bool

type Predicate added in v0.1.12

type Predicate[T any] func(T) bool

Predicate 断言是否满足指定条件

type PredicateKV added in v0.1.12

type PredicateKV[K, V any] func(K, V) bool

Predicate 断言是否满足指定条件

type Supplier added in v0.1.12

type Supplier[T any] func() T

Supplier 产生一个元素

type SupplierKV added in v0.1.12

type SupplierKV[K, V any] func() (K, V)

SupplierKV 产生一个KV

type Task

type Task func(context.Context)

type TaskWithErr

type TaskWithErr func(context.Context) error

type UnaryFunction added in v0.1.12

type UnaryFunction[T, R any] func(T) R

UnaryFunction 将一个类型转为另一个类型

type UnaryKVFunction added in v0.1.12

type UnaryKVFunction[K, V, R any] func(K, V) R

UnaryKVFunction 将一个类型转为另一个类型

type UnaryKVFunction2 added in v0.1.12

type UnaryKVFunction2[K, V, RK, RV any] func(K, V) (RK, RV)

type UnaryKVOperator added in v0.1.12

type UnaryKVOperator[K, V any] func(K, V) (K, V)

type UnaryOperator added in v0.1.12

type UnaryOperator[T any] func(T) T

UnaryOperator 对输入进行一元运算返回相同类型的结果

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL