cache

package
v0.0.0-...-56e3ae8 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: AGPL-3.0 Imports: 10 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearBlocksIAL

func ClearBlocksIAL()

func ClearDocsIAL

func ClearDocsIAL()

func ClearTreeCache

func ClearTreeCache()

func ExistAsset

func ExistAsset(path string) (ret bool)

func FilterAssets

func FilterAssets(filter func(path string, asset *Asset) bool) (ret map[string]*Asset)

FilterAssets 根据过滤函数返回符合条件的资源

func GetBlockIAL

func GetBlockIAL(id string) (ret map[string]string)

func GetDocIAL

func GetDocIAL(p string) (ret map[string]string)

func GetTreeData

func GetTreeData(rootID string) (raw []byte, ok bool)

func IterateAssets

func IterateAssets(fn func(path string, asset *Asset) bool)

IterateAssets 遍历所有资源,适合只读场景

func LoadAssets

func LoadAssets()

func PutBlockIAL

func PutBlockIAL(id string, ial map[string]string)

func PutDocIAL

func PutDocIAL(p string, ial map[string]string)

func RemoveAsset

func RemoveAsset(path string)

func RemoveAssetHash

func RemoveAssetHash(hash string)

func RemoveBlockIAL

func RemoveBlockIAL(id string)

func RemoveDocIAL

func RemoveDocIAL(p string)

func RemoveTreeData

func RemoveTreeData(rootID string)

func SetAssetHash

func SetAssetHash(hash, path string)

func SetTreeData

func SetTreeData(rootID string, raw []byte)

Types

type Asset

type Asset struct {
	HName   string `json:"hName"`
	Path    string `json:"path"`
	Updated int64  `json:"updated"`
}

func GetAssetByPath

func GetAssetByPath(path string) *Asset

GetAssetByPath 根据路径获取资源

type AssetHash

type AssetHash struct {
	Hash string `json:"hash"`
	Path string `json:"path"`
}

func GetAssetHash

func GetAssetHash(hash string) *AssetHash

func GetAssetHashByPath

func GetAssetHashByPath(path string) *AssetHash

Jump to

Keyboard shortcuts

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