selectTrue.go 434 Bytes
Newer Older
Eric Myhre's avatar
Eric Myhre committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
package selector

import (
	ipld "github.com/ipld/go-ipld-prime"
)

// SelectAll is a dummy selector that other selectors can return to say
// "the content at this path?  definitely this".
type SelectTrue struct{}

func (s SelectTrue) Interests() []PathSegment {
	return []PathSegment{}
}

func (s SelectTrue) Explore(n ipld.Node, p PathSegment) Selector {
	return nil
}

func (s SelectTrue) Decide(n ipld.Node) bool {
	return true
}