Documentation
¶
Index ¶
- func Create(tpl *v0.RelationTuple) *v0.RelationTupleUpdate
- func Delete(tpl *v0.RelationTuple) *v0.RelationTupleUpdate
- func FromRelationship(r *v1.Relationship) *v0.RelationTuple
- func ObjectAndRelation(ns, oid, rel string) *v0.ObjectAndRelation
- func RelString(tpl *v1.Relationship) string
- func Scan(tpl string) *v0.RelationTuple
- func ScanONR(onr string) *v0.ObjectAndRelation
- func String(tpl *v0.RelationTuple) string
- func StringONR(onr *v0.ObjectAndRelation) string
- func StringsONRs(onrs []*v0.ObjectAndRelation) []string
- func ToFilter(tpl *v0.RelationTuple) *v1.RelationshipFilter
- func ToRelationship(tpl *v0.RelationTuple) *v1.Relationship
- func Touch(tpl *v0.RelationTuple) *v0.RelationTupleUpdate
- func UpdateFromRelationshipUpdate(update *v1.RelationshipUpdate) *v0.RelationTupleUpdate
- func UpdateToRelationshipUpdate(update *v0.RelationTupleUpdate) *v1.RelationshipUpdate
- func User(userset *v0.ObjectAndRelation) *v0.User
- type ONRSet
- func (ons *ONRSet) Add(onr *v0.ObjectAndRelation) bool
- func (ons *ONRSet) AsSlice() []*v0.ObjectAndRelation
- func (ons *ONRSet) Has(onr *v0.ObjectAndRelation) bool
- func (ons *ONRSet) Intersect(otherSet *ONRSet) *ONRSet
- func (ons *ONRSet) IsEmpty() bool
- func (ons *ONRSet) Length() uint32
- func (ons *ONRSet) Subtract(otherSet *ONRSet) *ONRSet
- func (ons *ONRSet) Update(onrs []*v0.ObjectAndRelation)
- func (ons *ONRSet) UpdateFrom(otherSet *ONRSet)
- func (ons *ONRSet) With(onr *v0.ObjectAndRelation) *ONRSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Create ¶
func Create(tpl *v0.RelationTuple) *v0.RelationTupleUpdate
func Delete ¶
func Delete(tpl *v0.RelationTuple) *v0.RelationTupleUpdate
func FromRelationship ¶ added in v0.0.2
func FromRelationship(r *v1.Relationship) *v0.RelationTuple
FromRelationship converts a Relationship into a RelationTuple.
func ObjectAndRelation ¶
func ObjectAndRelation(ns, oid, rel string) *v0.ObjectAndRelation
func RelString ¶ added in v0.0.2
func RelString(tpl *v1.Relationship) string
RelString converts a relationship into a string.
func Scan ¶
func Scan(tpl string) *v0.RelationTuple
Scan converts a serialized tuple into the proto version
func ScanONR ¶
func ScanONR(onr string) *v0.ObjectAndRelation
ScanONR converts a string representation of an ONR to a proto object.
func StringONR ¶
func StringONR(onr *v0.ObjectAndRelation) string
StringONR converts an ONR object to a string.
func StringsONRs ¶
func StringsONRs(onrs []*v0.ObjectAndRelation) []string
StringsONRs converts ONR objects to a string slice, sorted.
func ToFilter ¶ added in v0.0.2
func ToFilter(tpl *v0.RelationTuple) *v1.RelationshipFilter
ToFilter converts a RelationTuple into a RelationshipFilter.
func ToRelationship ¶ added in v0.0.2
func ToRelationship(tpl *v0.RelationTuple) *v1.Relationship
ToRelationship converts a RelationTuple into a Relationship.
func Touch ¶
func Touch(tpl *v0.RelationTuple) *v0.RelationTupleUpdate
func UpdateFromRelationshipUpdate ¶ added in v0.0.2
func UpdateFromRelationshipUpdate(update *v1.RelationshipUpdate) *v0.RelationTupleUpdate
UpdateFromRelationshipUpdate converts a RelationshipUpdate into a RelationTupleUpdate.
func UpdateToRelationshipUpdate ¶ added in v0.0.2
func UpdateToRelationshipUpdate(update *v0.RelationTupleUpdate) *v1.RelationshipUpdate
UpdateToRelationshipUpdate converts a RelationTupleUpdate into a RelationshipUpdate.
Types ¶
type ONRSet ¶
type ONRSet struct {
// contains filtered or unexported fields
}
ONRSet is a set of ObjectAndRelation's.
func (*ONRSet) Add ¶
func (ons *ONRSet) Add(onr *v0.ObjectAndRelation) bool
Add adds the given ONR to the set. Returns true if the object was not in the set before this call and false otherwise.
func (*ONRSet) AsSlice ¶
func (ons *ONRSet) AsSlice() []*v0.ObjectAndRelation
AsSlice returns the ONRs found in the set as a slice.
func (*ONRSet) Has ¶
func (ons *ONRSet) Has(onr *v0.ObjectAndRelation) bool
Has returns true if the set contains the given ONR.
func (*ONRSet) Intersect ¶
Intersect returns an intersection between this ONR set and the other set provided.
func (*ONRSet) Subtract ¶
Subtract returns a subtraction from this ONR set of the other set provided.
func (*ONRSet) Update ¶
func (ons *ONRSet) Update(onrs []*v0.ObjectAndRelation)
Update updates the set by adding the given ONRs to it.
func (*ONRSet) UpdateFrom ¶
UpdateFrom updates the set by adding the ONRs found in the other set to it.