selector.go 754 Bytes
Newer Older
1 2 3
package selector

import (
4
	cid "github.com/ipfs/go-cid"
5 6 7
	ipld "github.com/ipfs/go-ipld-format"
)

8
// Selector is an interface for an IPLD Selector.
9 10 11 12
type Selector interface {
	ipld.Node
}

13 14
// SelectionResponse is an interface that represents part of the results
// of a selector query.
15 16 17 18
type SelectionResponse interface {
	ipld.Node
}

19 20
// SelectionTraverser is an interface for navigating a response to a selector
// query.
21 22 23 24 25
type SelectionTraverser interface {
	Next() (SelectionResponse, error)
	Cancel()
}

26 27
// SelectorQuerier can be used to make and validate selector queries.
type SelectorQuerier interface {
28 29
	Select(Selector, root cid.Cid) SelectionTraverser
	Validate(Selector, root cid.Cid, incomingResponses SelectionTraverser) SelectionTraverser
30
}