21 lines
632 B
Go
21 lines
632 B
Go
package treestorage
|
|
|
|
import (
|
|
"context"
|
|
"github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/object/tree/treechangeproto"
|
|
)
|
|
|
|
type TreeStorage interface {
|
|
Id() string
|
|
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)
|
|
HasChange(ctx context.Context, id string) (bool, error)
|
|
Delete() error
|
|
}
|
|
|
|
type TreeStorageCreatorFunc = func(payload TreeStorageCreatePayload) (TreeStorage, error)
|