cache

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ICache

type ICache interface {

	//KeyName key
	KeyName() string

	// PrimaryKey 返回主键名称,
	PrimaryKey(model interface{}) string

	// GetAllData 获取所有数据
	GetAllData() (data interface{}, err error)
}

ICache 缓存接口

type MemCache

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

MemCache MemCache

func NewMemCache

func NewMemCache() *MemCache

NewMemCache NewMemCache

func (*MemCache) GetAll

func (m *MemCache) GetAll(obj ICache) (data interface{}, err error)

GetAll 获取obj的所有缓存数据

func (*MemCache) GetItem

func (m *MemCache) GetItem(obj ICache, id int64) (item interface{}, err error)

GetItem 取[]data中的一项数据

func (*MemCache) Remove

func (m *MemCache) Remove(obj ICache)

Remove 移出key对应的缓存

Jump to

Keyboard shortcuts

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