mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
31 lines
783 B
Go
31 lines
783 B
Go
package thread
|
|
|
|
import (
|
|
"context"
|
|
"github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/aclchanges"
|
|
"github.com/anytypeio/go-anytype-infrastructure-experiments/pkg/acl/thread/pb"
|
|
)
|
|
|
|
// TODO: change methods to have errors as a return parameter, because we will be dealing with a real database
|
|
type Thread interface {
|
|
ID() string
|
|
|
|
Header() *pb.ThreadHeader
|
|
Heads() []string
|
|
Orphans() []string
|
|
SetHeads(heads []string)
|
|
RemoveOrphans(orphan ...string)
|
|
AddOrphans(orphan ...string)
|
|
|
|
AddRawChange(change *RawChange) error
|
|
AddChange(change aclchanges.Change) error
|
|
|
|
// TODO: have methods with raw changes also
|
|
GetChange(ctx context.Context, recordID string) (*RawChange, error)
|
|
}
|
|
|
|
type RawChange struct {
|
|
Payload []byte
|
|
Signature []byte
|
|
Id string
|
|
}
|