any-sync/pkg/acl/storage/treestorage.go
2022-09-25 13:50:35 +02:00

19 lines
528 B
Go

package storage
import (
"context"
"github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/treechangeproto"
)
type TreeStorage interface {
Storage
Root() (*treechangeproto.RawTreeChangeWithId, error)
Heads() ([]string, error)
SetHeads(heads []string) error
AddRawChange(change *treechangeproto.RawTreeChangeWithId) error
GetRawChange(ctx context.Context, id string) (*treechangeproto.RawTreeChangeWithId, error)
}
type TreeStorageCreatorFunc = func(payload TreeStorageCreatePayload) (TreeStorage, error)