2022-09-17 22:18:11 +02:00

28 lines
622 B
Go

package cache
import (
"context"
"github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/synctree"
"github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/tree"
)
const CName = "commonspace.cache"
type TreeContainer interface {
Tree() tree.ObjectTree
}
type TreeResult struct {
Release func()
TreeContainer TreeContainer
}
type BuildFunc = func(ctx context.Context, id string, listener synctree.UpdateListener) (tree.ObjectTree, error)
type TreeCache interface {
GetTree(ctx context.Context, id string) (TreeResult, error)
SetBuildFunc(f BuildFunc)
Close() error
}