gl

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientIp = "glClientIp"
	Tag      = "glTag"
	LogId    = "glLogId"
)

Variables

This section is empty.

Functions

func BatchGet

func BatchGet(keys []interface{}) map[interface{}]interface{}

func Close

func Close()

func Decr added in v1.6.6

func Decr(key interface{}, count int64) int64

func Del

func Del(key interface{})

func Get

func Get(key interface{}) (interface{}, bool)

func GetCurrentGlData added in v1.6.6

func GetCurrentGlData() map[string]interface{}

func Incr added in v1.6.6

func Incr(key interface{}, count int64) int64

func IncrCost added in v1.6.6

func IncrCost(key interface{}, cost time.Duration) int64

func IncrCostKey added in v1.6.6

func IncrCostKey(key string, cost time.Duration) int64

func IncrCountKey added in v1.6.6

func IncrCountKey(key string, val int64) int64

func IncrFailKey added in v1.6.6

func IncrFailKey(key string, val int64) int64

func Init

func Init()

func Set

func Set(key interface{}, val interface{})

func SetLogger

func SetLogger(l Logger)

Types

type ConcurrentMap

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

func NewShard

func NewShard(shardCount int) *ConcurrentMap

func (*ConcurrentMap) Get

func (m *ConcurrentMap) Get(key string) (interface{}, bool)

func (*ConcurrentMap) GetShard

func (m *ConcurrentMap) GetShard(key string) *Shard

func (*ConcurrentMap) Remove

func (m *ConcurrentMap) Remove(key string)

func (*ConcurrentMap) Set

func (m *ConcurrentMap) Set(key string, value interface{})

type Logger

type Logger interface {
	Debug(format interface{}, v ...interface{})
	Info(format interface{}, v ...interface{})
	Error(format interface{}, v ...interface{}) error
}

type Shard

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

Jump to

Keyboard shortcuts

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