cache

package
v1.3.1-pre-6 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package cache impl the cache for gocq

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Init 初始化 Cache

Types

type Cache

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

Cache wraps the btree.DB for concurrent safe

var (
	Media Cache
)

Media Cache DBs

func (*Cache) Delete

func (c *Cache) Delete(md5 []byte)

Delete 删除指定缓存

func (*Cache) Get

func (c *Cache) Get(md5 []byte) *pb.DatabaseRecord

Get 获取缓存信息

func (*Cache) Insert

func (c *Cache) Insert(md5 []byte, record *pb.DatabaseRecord)

Insert 添加媒体缓存

func (*Cache) ScanExpiredData

func (c *Cache) ScanExpiredData()

ScanExpiredData 扫描并删除过期数据,防止gocq的数据库越来越肥硕

Jump to

Keyboard shortcuts

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