models

package
v0.0.0-...-baaee6e Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HLL_P                 = 14
	HLL_M                 = 1 << HLL_P // Register count (16384)
	HLL_MAX_ENCODING_SIZE = 12000
)

Variables

View Source
var (
	ErrMaxRetriesExceeded = errors.New("maximum retry attempts exceeded")
	ErrOperationTimeout   = errors.New("operation timeout")
)
View Source
var DefaultRetryStrategy = RetryStrategy{
	MaxAttempts:     3,
	InitialInterval: 100 * time.Millisecond,
	MaxInterval:     2 * time.Second,
	Multiplier:      2.0,
	Timeout:         5 * time.Second,
}

Functions

This section is empty.

Types

type BitFieldCommand

type BitFieldCommand struct {
	Op        string
	Type      string
	Offset    int64
	Value     int64
	Increment int64
}

type BloomFilter

type BloomFilter struct {
	// contains filtered or unexported fields
}

func NewBloomFilter

func NewBloomFilter(config BloomFilterConfig) *BloomFilter

func (*BloomFilter) Add

func (bf *BloomFilter) Add(item []byte)

func (*BloomFilter) ApproximateCount

func (bf *BloomFilter) ApproximateCount() uint

func (*BloomFilter) Clear

func (bf *BloomFilter) Clear()

func (*BloomFilter) Contains

func (bf *BloomFilter) Contains(item []byte) bool

func (*BloomFilter) FalsePositiveRate

func (bf *BloomFilter) FalsePositiveRate() float64

func (*BloomFilter) Stats

func (bf *BloomFilter) Stats() BloomFilterStats

type BloomFilterConfig

type BloomFilterConfig struct {
	ExpectedItems     uint
	FalsePositiveRate float64
}

type BloomFilterStats

type BloomFilterStats struct {
	Size              uint
	HashCount         uint
	Count             uint
	BitsetSize        uint
	SetBits           uint
	FalsePositiveRate float64
	MemoryUsage       uint // bytes
}

type Command

type Command struct {
	Name string
	Args []Value
}

type HyperLogLog

type HyperLogLog struct {
	Registers []uint8
	Encoding  byte // dense: 1, sparse: 2
	Size      int64
}

HyperLogLog struct

func NewHyperLogLog

func NewHyperLogLog() *HyperLogLog

func (*HyperLogLog) Add

func (h *HyperLogLog) Add(hash uint64) bool

func (*HyperLogLog) Estimate

func (h *HyperLogLog) Estimate() float64

func (*HyperLogLog) Merge

func (h *HyperLogLog) Merge(other *HyperLogLog)

type MemoryStats

type MemoryStats struct {
	TotalMemory     int64
	UsedMemory      int64
	FragmentedBytes int64
	LastDefrag      time.Time
	DefragCount     int64
}

type PendingMessage

type PendingMessage struct {
	Consumer     string
	DeliveryTime time.Time
	Deliveries   int
}

type Pipeline

type Pipeline struct {
	Commands []PipelineCommand
}

type PipelineCommand

type PipelineCommand struct {
	Name string
	Args []Value
}

type RetryStrategy

type RetryStrategy struct {
	MaxAttempts     int
	InitialInterval time.Duration
	MaxInterval     time.Duration
	Multiplier      float64
	Timeout         time.Duration
}

type StreamConsumer

type StreamConsumer struct {
	Name     string
	Pending  int64
	IdleTime int64
}

type StreamConsumerGroup

type StreamConsumerGroup struct {
	Consumers map[string]*StreamConsumer
	LastID    string
	Pending   map[string]*PendingMessage
}

type StreamEntry

type StreamEntry struct {
	ID     string
	Fields map[string]string
}

type StreamGroup

type StreamGroup struct {
	Name            string
	Consumers       int64
	Pending         int64
	LastDeliveredID string
}

type StreamInfo

type StreamInfo struct {
	Length          int64
	RadixTreeKeys   int64
	RadixTreeNodes  int64
	Groups          int64
	LastGeneratedID string
	FirstEntry      *StreamEntry
	LastEntry       *StreamEntry
}

type Transaction

type Transaction struct {
	Commands []Command
	InMulti  bool
	Watches  map[string]int64
}

type Value

type Value struct {
	Type  string
	Str   string
	Num   int
	Bulk  string
	Array []Value
}

func (Value) IsCommand

func (v Value) IsCommand(cmd string) bool

type ZSetMember

type ZSetMember struct {
	Member string
	Score  float64
}

Jump to

Keyboard shortcuts

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