xcache

package module
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

README

xcache

less is more cache

Feature

  • high performance base on bigcahe
  • reduce golang gc and STW
  • generic api base on golang generic

usage

see example

global_cache.go is a simple golbal cache usage new_cache.go is a custom cache usage

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close added in v0.3.2

func Close(xc *XCache)

func Del added in v0.3.0

func Del[X any](key X)

func Get

func Get[X, Y any](key X) Y

func Init

func Init(expire time.Duration)

Init initializes the cache

func Set

func Set[X, Y any](key X, value Y)

func XDel added in v0.3.0

func XDel[X any](xc *XCache, key X)

func XGet added in v0.2.0

func XGet[X, Y any](xc *XCache, key X) Y

func XSet added in v0.2.0

func XSet[X, Y any](xc *XCache, key X, value Y)

Types

type XCache added in v0.2.0

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

XCache is a wrapper of bigcache.BigCache

func New added in v0.2.0

func New(config bigcache.Config) *XCache

New returns a new XCache

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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