gl

package
v1.7.17 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 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

func CopyGlData(glJsonObj *js.Json)

func Decr

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

func Del

func Del(key interface{})

func Exist

func Exist() bool

Exist find out if current ctx has been init

func Get

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

func GetCurrentGlData

func GetCurrentGlData() map[string]interface{}

func GetGlData

func GetGlData() *js.Json

func Incr

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

func IncrCost

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

func IncrCostKey

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

func IncrCountKey

func IncrCountKey(key string, val int64) int64

func IncrFailKey

func IncrFailKey(key string, val int64) int64

func Init

func Init()

func JsonCurrentGlData

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