Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FoundSubject ¶
type FoundSubject struct {
// contains filtered or unexported fields
}
FoundSubject contains a single found subject and all the relationships in which that subject is a member which were found via the ONRs expansion.
func (FoundSubject) Relationships ¶
func (fs FoundSubject) Relationships() []*v0.ObjectAndRelation
Relationships returns all the relationships in which the subject was found as per the expand.
func (FoundSubject) Subject ¶
func (fs FoundSubject) Subject() *v0.ObjectAndRelation
Subject returns the Subject of the FoundSubject.
type FoundSubjects ¶
type FoundSubjects struct {
// contains filtered or unexported fields
}
FoundSubjects contains the subjects found for a specific ONR.
func (FoundSubjects) ListFound ¶
func (fs FoundSubjects) ListFound() []FoundSubject
ListFound returns a slice of all the FoundSubject's.
func (FoundSubjects) LookupSubject ¶
func (fs FoundSubjects) LookupSubject(subject *v0.ObjectAndRelation) (FoundSubject, bool)
LookupSubject returns the FoundSubject for a matching subject, if any.
type MembershipSet ¶
type MembershipSet struct {
// contains filtered or unexported fields
}
MembershipSet represents the set of membership for one or more ONRs, based on expansion trees.
func NewMembershipSet ¶
func NewMembershipSet() *MembershipSet
NewMembershipSet constructs a new membership set.
NOTE: This is designed solely for the developer API and should *not* be used in any performance sensitive code.
func (*MembershipSet) AddExpansion ¶
func (ms *MembershipSet) AddExpansion(onr *v0.ObjectAndRelation, expansion *v0.RelationTupleTreeNode) (FoundSubjects, bool, error)
AddExpansion adds the expansion of an ONR to the membership set. Returns false if the ONR was already added.
NOTE: The expansion tree *should* be the fully recursive expansion.
func (*MembershipSet) SubjectsByONR ¶
func (ms *MembershipSet) SubjectsByONR() map[string]FoundSubjects
SubjectsByONR returns a map from ONR (as a string) to the FoundSubjects for that ONR.