Documentation ¶
Index ¶
- Constants
- Variables
- func KeyHash(key interface{}) uint32
- type Bitmap
- type CanHash
- type Container
- type Float
- type Int
- type Integer
- type JsonParam
- func (jp JsonParam) Exists(key string) bool
- func (jp JsonParam) Float64(key string) float64
- func (jp JsonParam) Int(key string) int
- func (jp JsonParam) Int64(key string) int64
- func (jp JsonParam) Int64Slice(key string) []int64
- func (jp JsonParam) IntSlice(key string) []int
- func (jp JsonParam) String(key string) string
- func (jp JsonParam) StringSlice(key string) []string
- func (jp JsonParam) Uint32Slice(key string) []uint32
- type Key
- type Map
- type Number
- type RedisValue
- type Set
- type Shard
- type ShardMap
- type Slice
- type State
- func (s *State) Add(indexList ...uint8) error
- func (s *State) Has(index uint8) bool
- func (s *State) Intersection(val State) []uint8
- func (s *State) Merge(val State)
- func (s *State) Remove(index uint8)
- func (s *State) RemoveAll()
- func (s *State) Slice() []uint8
- func (s *State) UnionSet(val State) []uint8
- func (s *State) ValueSlice() []int32
- type Uint
Constants ¶
View Source
const (
StateIndexMax = 30
)
Variables ¶
View Source
var Empty = struct{}{}
View Source
var (
ErrIndex = errors.New("index out of range")
)
View Source
var Uint32Hash = crc32.ChecksumIEEE
Functions ¶
Types ¶
type Bitmap ¶
type Bitmap interface { // HasBit 是否有值 HasBit() bool // BitCount 值的数量 BitCount() int // Exists 标签是否存在 Exists(tag int) (exists bool) // AddTag 添加标签 AddTag(tag int) Bitmap // DelTag 删除标签 DelTag(tag int) Bitmap // Data 原始数据 Data() (data []byte) // SprinfBinary 二进制打印 SprinfBinary() string }
Bitmap bitmap数据结构
type CanHash ¶
type CanHash interface { // HashCode 计算hash值 HashCode() (hashValue uint32) }
CanHash hash接口
type Container ¶
type Container[K comparable] interface { Set(key K, value any) Get(key K) (value any, exists bool) }
func NewContainer ¶
func NewContainer[K comparable]() Container[K]
type JsonParam ¶ added in v2.0.9
func (JsonParam) Int64Slice ¶ added in v2.0.9
Int64Slice 获取[]int64,获取失败返回nil
func (JsonParam) StringSlice ¶ added in v2.0.9
StringSlice 获取[]string,如果不是[]string返回nil
func (JsonParam) Uint32Slice ¶ added in v2.0.9
Uint32Slice 获取[]uint32,获取失败返回nil
type Map ¶
type Map[K comparable, V any] map[K]V
type Set ¶
type Set[V comparable] interface { Add(value V) (isNew bool) Del(list ...V) (delNum int) Exists(value V) (exists bool) Length() (length int) List() (list Slice[V]) Pop() (value V) Rand() (value V) }
func NewConcurrentSet ¶
func NewConcurrentSet[V comparable](initSize uint) Set[V]
func NewSet ¶
func NewSet[V comparable](initSize uint) Set[V]
type Shard ¶
type ShardMap ¶
type ShardMap[K Key] interface { // Set 存储 Set(key K, value any) (isCreate bool) // Get 获取 Get(key K) (value any, exists bool) // Exists 是否存在 Exists(key K) (exists bool) // Delete 删除 Delete(keys ...K) (delNum int) // Length 长度 Length() int64 // ShardLength 返回每个分片的长度,可以协助分析元素是否平均分配 ShardLength() []int64 // Range 按照分片遍历元素 Range(handler func(key K, value any) bool) }
ShardMap 分片Map
type State ¶
type State int32
func StateFromSlice ¶
func StatusFromValueSlice ¶
func (*State) Intersection ¶
func (*State) ValueSlice ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.