Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CanBeClientKey ¶
type CanBeClientKeyBatch ¶
type CanBeConsumer ¶
type CanBeConsumer interface { RegistHandler(topic string, fn event.Handdler) error UnRegistHandler(topic string) error Listen(asyncHanddler bool, p ...event.Parser) error StopListening() error }
CanBeConsumer 消费者对象的接口
type CanBeCount ¶
CanBeCount 可以被计数
type CanBeDisctinctCounter ¶
type CanBeDisctinctCounter interface { CanBeCount Add(context.Context, ...interface{}) error AddM(context.Context, ...interface{}) error Union(context.Context, *clientkey.ClientKey, ...CanBeDisctinctCounter) (CanBeDisctinctCounter, error) }
type CanBeGenerator ¶
CanBeGenerator 生成器的接口
type CanBeLimiter ¶
type CanBeLimiter interface { //注水,返回值true表示注水成功,false表示满了无法注水,抛出异常返回true Flood(context.Context, int64) (bool, error) //水位 WaterLevel(context.Context) (int64, error) //容量 Capacity() int64 //是否容量已满 IsFull(context.Context) (bool, error) //重置 Reset(context.Context) error }
CanBeLimiter 限制器接口
type CanBeProducer ¶
type CanBeProducer interface { Publish(ctx context.Context, payload interface{}) error PubEvent(ctx context.Context, payload interface{}) (*event.Event, error) }
CanBeProducer 生产者对象的接口
type CanBeSet ¶
type CanBeSet interface { CanBeDisctinctCounter Remove(context.Context, ...interface{}) error RemoveM(context.Context, ...interface{}) error Contained(context.Context, interface{}) (bool, error) ToArray(context.Context) ([]interface{}, error) Intersection(context.Context, *clientkey.ClientKey, ...CanBeSet) (CanBeSet, error) Except(context.Context, *clientkey.ClientKey, CanBeSet) (CanBeSet, error) Xor(context.Context, *clientkey.ClientKey, CanBeSet) (CanBeSet, error) }
CanBeSet 可以被看作时Set的结构对象
type CanHanddlerLifeCycle ¶
Directories ¶
Path | Synopsis |
---|---|
Package bitmap bitmap操作支持 bitmap可以用于分布式去重 bitmap实现了一般set的常用接口(Add,Remove,Contained,Len,ToArray)
|
Package bitmap bitmap操作支持 bitmap可以用于分布式去重 bitmap实现了一般set的常用接口(Add,Remove,Contained,Len,ToArray) |
pubsub
Package 发布订阅器对象 Package pubsub 发布订阅器对象 非常适合作为简单的广播模式的中间件
|
Package 发布订阅器对象 Package pubsub 发布订阅器对象 非常适合作为简单的广播模式的中间件 |
queue
Package queue 队列对象 非常适合作为简单的生产者消费者模式的中间件 Package queue 队列对象 非常适合作为简单的生产者消费者模式的中间件 Package queue 队列对象 非常适合作为简单的生产者消费者模式的中间件
|
Package queue 队列对象 非常适合作为简单的生产者消费者模式的中间件 Package queue 队列对象 非常适合作为简单的生产者消费者模式的中间件 Package queue 队列对象 非常适合作为简单的生产者消费者模式的中间件 |
stream
Package stream 流及相关对象的包 Package stream 流及相关对象的包
|
Package stream 流及相关对象的包 Package stream 流及相关对象的包 |
Package cache 缓存对象 更新缓存往往是竞争更新,因此需要使用分布式锁避免重复计算,同时等待更新完成后再取数据.
|
Package cache 缓存对象 更新缓存往往是竞争更新,因此需要使用分布式锁避免重复计算,同时等待更新完成后再取数据. |
Package key redis的key包装 Package key redis的key包装
|
Package key redis的key包装 Package key redis的key包装 |
clientkeybatch
Package clientkeybatch redis的keybatch包装
|
Package clientkeybatch redis的keybatch包装 |
counter
|
|
hashcounter
Package counter Counter操作支持 Counter可以用于分布式累加计数
|
Package counter Counter操作支持 Counter可以用于分布式累加计数 |
keycounter
Package keycounter string型计数器
|
Package keycounter string型计数器 |
redis_cell/limiter
Package limiter 限制器 可以用于防止短时间内大量请求同时处理,比如缓存防击穿,防爬虫等
|
Package limiter 限制器 可以用于防止短时间内大量请求同时处理,比如缓存防击穿,防爬虫等 |
Package hypercount 面向对象的计数估计类型 HyperCount 用于粗略统计大量数据去重后的个数,一般用在日活计算
|
Package hypercount 面向对象的计数估计类型 HyperCount 用于粗略统计大量数据去重后的个数,一般用在日活计算 |
Package keyspace_notifications对象
|
Package keyspace_notifications对象 |
Package limiter 限制器 可以用于防止短时间内大量请求同时处理,比如缓存防击穿,防爬虫等
|
Package limiter 限制器 可以用于防止短时间内大量请求同时处理,比如缓存防击穿,防爬虫等 |
Package lock 分布式锁实现 分布式锁需要有客户端信息,只可以获得锁的客户端自己解锁或者等待锁自己过期 当未能获得锁需要等待锁释放时可以通过wait接口实现
|
Package lock 分布式锁实现 分布式锁需要有客户端信息,只可以获得锁的客户端自己解锁或者等待锁自己过期 当未能获得锁需要等待锁释放时可以通过wait接口实现 |
Package randomkey 随机生成一个key 使用sony实现的snowflake算法 默认的设置为 StartTime: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC),MachineID则会默认尝试使用本机的第一张网卡的mac地址最后1位,如果获取不到则会使用默认值0
|
Package randomkey 随机生成一个key 使用sony实现的snowflake算法 默认的设置为 StartTime: time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC),MachineID则会默认尝试使用本机的第一张网卡的mac地址最后1位,如果获取不到则会使用默认值0 |
Package ranker 排序器类型 ranker可以用于分布式排序操作 即多个worker分别计算更新一部分元素的权重,业务端则只负责读取结果
|
Package ranker 排序器类型 ranker可以用于分布式排序操作 即多个worker分别计算更新一部分元素的权重,业务端则只负责读取结果 |
Package scanfinder 使用scan遍历查询的工具
|
Package scanfinder 使用scan遍历查询的工具 |
Click to show internal directories.
Click to hide internal directories.