gl

package
v1.7.19 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientIp   = "glClientIp"
	Tag        = "glTag"
	LogId      = "glLogId"
	Url        = "glUrl"
	HideData   = "glHideData"
	HideRet    = "glHideRet"
	Server     = "glServer"
	SecretKey  = "glSecretKey"
	GdTokenRaw = "gdTokenRaw"
	GdToken    = "gdToken"
)

Variables

This section is empty.

Functions

func BatchGet

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

func Close

func Close()

func CopyGlData added in v1.7.9

func CopyGlData(glJsonObj *js.Json)

func Decr added in v1.6.6

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

func Del

func Del(key interface{})

func Exist added in v1.7.0

func Exist() bool

Exist find out if current ctx has been init

func Get

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

func GetCurrentGlData added in v1.6.6

func GetCurrentGlData() map[string]interface{}

func GetGlData added in v1.7.9

func GetGlData() *js.Json

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 JsonCurrentGlData added in v1.7.9

func JsonCurrentGlData() *js.Json

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