Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitsetSolutionIterator ¶
type BitsetSolutionIterator struct {
// contains filtered or unexported fields
}
BitsetSolutionIterator implements SolutionIterator using a bitset. Iterates through subsets of descriptor IDs in an order that reaches all subsets of the first k input descriptors before adding descriptor k+1.
func NewBitsetIterator ¶
func NewBitsetIterator(req *RequirementLogic, descs []string) *BitsetSolutionIterator
NewBitsetIterator returns a BitsetSolutionIterator instantiated to iterate solutions to req using descriptor IDs in descs.
func (*BitsetSolutionIterator) Next ¶
func (b *BitsetSolutionIterator) Next(excludeIDs []string) []string
Next returns the next valid solution to b's RequirementLogic, or nil if iteration is complete.
type DescriptorIDSet ¶
type DescriptorIDSet = StringSet
DescriptorIDSet is a set of InputDescriptor IDs.
type RequirementLogic ¶
type RequirementLogic struct { InputDescriptorIDs []string Nested []*RequirementLogic Count int Min int Max int }
RequirementLogic is a datatype for processing nested submission requirement logic.
func (*RequirementLogic) GetAllDescriptors ¶
func (r *RequirementLogic) GetAllDescriptors() DescriptorIDSet
GetAllDescriptors returns the IDs of all InputDescriptors referenced in this RequirementLogic or its children.
func (*RequirementLogic) IsSatisfiedBy ¶
func (r *RequirementLogic) IsSatisfiedBy(descs DescriptorIDSet) bool
IsSatisfiedBy returns whether the given requirement logic is satisfied by the given set of descriptors.
func (*RequirementLogic) Iterator ¶
func (r *RequirementLogic) Iterator(descriptors []string) SolutionIterator
Iterator returns a SolutionIterator that iterates through all solutions to req, using the given descriptor IDs.
type SolutionIterator ¶
type SolutionIterator interface { // Next returns a list of input descriptor IDs, denoting a set of input // descriptors that should satisfy the RequirementLogic this SolutionIterator // was created for. // // Parameter exclude: a list of input descriptors that should be excluded from // future iterations (for example, if they were evaluated and no credentials // were found to satisfy them). Next(exclude []string) []string }
SolutionIterator iterates through solutions to a RequirementLogic. Each solution is a list of Input Descriptor IDs, that should satisfy the RequirementLogic from which the SolutionIterator has been created.
type SolutionSet ¶
type SolutionSet map[string]DescriptorIDSet
SolutionSet holds sets of InputDescriptor ID. Each set is a combination of InputDescriptorIDs that satisfy the count rules of the SubmissionRequirement that this result was derived from.
type StringSet ¶
type StringSet map[string]struct{}
StringSet implements a set of strings.
func InitFromSlice ¶
InitFromSlice creates a new StringSet containing all the given values.