cache

package
v0.0.0-...-c8dcdd0 Latest Latest
Warning

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

Go to latest
Published: Jul 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 ClearAVCache

func ClearAVCache()

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 GetAVData

func GetAVData(avID string) (raw []byte, ok bool)

func GetAVDataInBox

func GetAVDataInBox(avID, boxID string) (raw []byte, ok bool)

func GetBlockIAL

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

func GetBlockIALInBox

func GetBlockIALInBox(id, boxID string) (ret map[string]string)

func GetBlockIALWithBoxFallback

func GetBlockIALWithBoxFallback(id, boxID string) (ret map[string]string)

GetBlockIALWithBoxFallback 先查 box-aware key,未命中再回退到 bare key。

写入端存在两套键命名空间:部分路径写 box-aware key(PutBlockIALInBox,用于加密笔记本隔离), 部分历史路径仍写 bare key(PutBlockIAL)。读取端若只查其一会漏掉另一侧的更新,因此这里按 box-aware 优先、bare key 回退的顺序查询,与 treenode.GetDynamicRefText 的回退策略保持一致。

func GetDocIALInBox

func GetDocIALInBox(p, boxID string) (ret map[string]string)

func GetTreeData

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

func GetTreeDataInBox

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

func LoadAssets

func LoadAssets()

func PutBlockIAL

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

func PutBlockIALInBox

func PutBlockIALInBox(id, boxID string, ial map[string]string)

func PutDocIALInBox

func PutDocIALInBox(p, boxID string, ial map[string]string)

func RemoveAVData

func RemoveAVData(avID string)

func RemoveAVDataInBox

func RemoveAVDataInBox(avID, boxID string)

func RemoveAsset

func RemoveAsset(path string)

func RemoveAssetHash

func RemoveAssetHash(hash string)

func RemoveBlockIAL

func RemoveBlockIAL(id string)

func RemoveBlockIALInBox

func RemoveBlockIALInBox(id, boxID string)

func RemoveDocIAL

func RemoveDocIAL(p string)

func RemoveDocIALInBox

func RemoveDocIALInBox(p, boxID string)

func RemoveTreeData

func RemoveTreeData(rootID string)

func RemoveTreeDataInBox

func RemoveTreeDataInBox(rootID, boxID string)

func SetAVData

func SetAVData(avID string, raw []byte)

func SetAVDataInBox

func SetAVDataInBox(avID, boxID string, raw []byte)

func SetAssetHash

func SetAssetHash(hash, path string)

func SetTreeData

func SetTreeData(rootID string, raw []byte)

func SetTreeDataInBox

func SetTreeDataInBox(rootID, boxID string, raw []byte)

Types

type Asset

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

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