icache

package module
v0.0.0-...-92c526b Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheItem

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

func Alloc

func Alloc(cacheName string, size int, unit CacheUnit) *CacheItem

func (*CacheItem) Get

func (c *CacheItem) Get(key string) ([]byte, error)

func (*CacheItem) GetAny

func (c *CacheItem) GetAny(key string, out interface{}) error

func (*CacheItem) GetInt

func (c *CacheItem) GetInt(key string) (int64, error)

func (*CacheItem) GetString

func (c *CacheItem) GetString(key string) (string, error)

func (*CacheItem) Set

func (c *CacheItem) Set(key string, value string, expire int) error

func (*CacheItem) SetAny

func (c *CacheItem) SetAny(key string, value interface{}, expire int) error

func (*CacheItem) SetInt

func (c *CacheItem) SetInt(key string, value int64, expire int) error

func (*CacheItem) SetString

func (c *CacheItem) SetString(key string, value string, expire int) error

type CacheUnit

type CacheUnit int
const (
	B CacheUnit = iota
	K
	M
	G
)

type LazyCacheItem

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

func GetLazyCache

func GetLazyCache(cacheName string, cacheTime time.Duration) *LazyCacheItem

func (*LazyCacheItem) Del

func (c *LazyCacheItem) Del(key string)

func (*LazyCacheItem) Get

func (c *LazyCacheItem) Get(key string) (interface{}, bool)

func (*LazyCacheItem) Set

func (c *LazyCacheItem) Set(key string, value interface{}, haveExpire bool)

type Service

type Service struct {
}

Jump to

Keyboard shortcuts

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