xcache

package
v0.0.0-...-80fcaa9 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLRU

func NewLRU(size int64) *lru

func Sum64

func Sum64(key string) uint64

Sum64 gets the string and returns its uint64 hash value.

Types

type AutoLoadHandler

type AutoLoadHandler func(key string) (interface{}, int64, error)

type Cache

type Cache interface {
	Get(key string) (string, error)
	MGet(key ...string) (map[string]string, error)
	Set(key, val string) error
	Incr(key string, val int) (int64, error)
	Expire(key string, expire int) error
}

type ItemVal

type ItemVal struct {
	Key    string
	Val    interface{}
	Expire int64
}

type QPS

type QPS struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewQqs

func NewQqs(name string, ttl int64) *QPS

func (*QPS) Close

func (c *QPS) Close() error

func (*QPS) GetQPS

func (c *QPS) GetQPS(sec int64) int64

func (*QPS) Incr

func (c *QPS) Incr() error

type QPSItem

type QPSItem struct {
	Val int64
}

Jump to

Keyboard shortcuts

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