selector.go 506 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
package selector

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

type Selector interface {
	ipld.Node
}

type SelectionResponse interface {
	ipld.Node
}

type SelectionTraverser interface {
	Next() (SelectionResponse, error)
	Cancel()
}

type SelectorManager interface {
	Select(Selector, root ipld.Node) SelectionTraverser
	Validate(Selector, root ipld.Node, incomingResponses SelectionTraverser) SelectionTraverser
	DecodeSelector([]byte) Selector
	DecodeSelectorResponse([]byte) SelectionResponse
}