~whereswaldon/forest-go

ref: cd38454fdf9fbb4c51ccaadbaf43266f3044be1d forest-go/store/extended-store.go -rw-r--r-- 744 bytes
cd38454fChris Waldon feat: gracefully handle corrupt nodes in groves 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package store

import (
	forest "git.sr.ht/~whereswaldon/forest-go"
	"git.sr.ht/~whereswaldon/forest-go/fields"
)

// ExtendedStore provides a superset of the functionality of the Store interface,
// implementing methods for subscribing to changes and querying higher-level
// structural information like ancestry and descendants.
type ExtendedStore interface {
	forest.Store
	SubscribeToNewMessages(handler func(n forest.Node)) Subscription
	UnsubscribeToNewMessages(Subscription)
	AddAs(forest.Node, Subscription) (err error)
	AncestryOf(id *fields.QualifiedHash) ([]*fields.QualifiedHash, error)
	DescendantsOf(id *fields.QualifiedHash) ([]*fields.QualifiedHash, error)
	LeavesOf(id *fields.QualifiedHash) ([]*fields.QualifiedHash, error)
}