memorykv

package
v1.6.9 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryKvBucket

type MemoryKvBucket interface {
	Get(key string) ([][]byte, error)
	Set(key string, value [][]byte) error
	SetEx(key string, value [][]byte, ttl time.Duration) error
	Delete(key string) error
	Expire(key string, ttl time.Duration) error
	Stats() MemoryKvStats
}

type MemoryKvBucketImpl

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

func (*MemoryKvBucketImpl) Delete

func (kvBucket *MemoryKvBucketImpl) Delete(key string) error

func (*MemoryKvBucketImpl) Expire

func (kvBucket *MemoryKvBucketImpl) Expire(key string, ttl time.Duration) error

func (*MemoryKvBucketImpl) Get

func (kvBucket *MemoryKvBucketImpl) Get(key string) ([][]byte, error)

func (*MemoryKvBucketImpl) Set

func (kvBucket *MemoryKvBucketImpl) Set(key string, value [][]byte) error

func (*MemoryKvBucketImpl) SetEx

func (kvBucket *MemoryKvBucketImpl) SetEx(key string, value [][]byte, ttl time.Duration) error

func (*MemoryKvBucketImpl) Stats

func (kvBucket *MemoryKvBucketImpl) Stats() MemoryKvStats

type MemoryKvDb

type MemoryKvDb interface {
	GetBucket(name string) MemoryKvBucket
	Stats() map[string]MemoryKvStats
}

func NewMemoryKvDb

func NewMemoryKvDb(options Options) MemoryKvDb

type MemoryKvDbImpl

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

func (*MemoryKvDbImpl) GetBucket

func (kvDb *MemoryKvDbImpl) GetBucket(name string) MemoryKvBucket

func (*MemoryKvDbImpl) Stats

func (kvDb *MemoryKvDbImpl) Stats() map[string]MemoryKvStats

type MemoryKvStats

type MemoryKvStats struct {
	Entries                int     `json:"entries"`
	AvgExpirationTime      float64 `json:"avgExpirationTime"`
	EarliestExpirationTime string  `json:"earliestExpirationTime"` // ISO 8601
	LatestExpirationTime   string  `json:"latestExpirationTime"`   // ISO 8601
	ExpirationQueueSize    int64   `json:"expirationQueueSize"`
	TotalSize              int64   `json:"totalSize"`
	AvgObjSize             float64 `json:"avgObjSize"`
	Misses                 int64   `json:"misses"`
	Hits                   int64   `json:"hits"`
}

type Options

type Options struct {
	Name string
}

Jump to

Keyboard shortcuts

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