selector.go 728 Bytes
Newer Older
1 2 3 4 5 6
package selector

import (
	ipld "github.com/ipfs/go-ipld-format"
)

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

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

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

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