Documentation ¶
Index ¶
- Constants
- func AreSubjectsEqual(s1 *base.Subject, s2 *base.Subject) bool
- func EntityAndRelationToString(entityAndRelation *base.EntityAndRelation) string
- func EntityToString(entity *base.Entity) string
- func IsEntityAndSubjectEquals(t *base.Tuple) bool
- func IsRelationComputed(relation string) bool
- func IsSubjectUser(subject *base.Subject) bool
- func IsSubjectValid(subject *base.Subject) bool
- func SplitRelation(relation string) (a []string)
- func SubjectToString(subject *base.Subject) string
- func ValidateSubject(subject *base.Subject) error
- func ValidateSubjectType(subject *base.Subject, relationTypes []string) (err error)
- type EntityCollection
- type EntityIterator
- type IEntityCollection
- type IEntityIterator
- type ISubjectCollection
- type ISubjectIterator
- type ITupleCollection
- type ITupleIterator
- type SubjectCollection
- type SubjectIterator
- type TupleCollection
- type TupleIterator
Constants ¶
const ( ENTITY = "%s:%s" RELATION = "#%s" )
const (
ELLIPSIS = "..."
)
const (
SEPARATOR = "."
)
const (
USER = "user"
)
Variables ¶
This section is empty.
Functions ¶
func AreSubjectsEqual ¶
AreSubjectsEqual -
func EntityAndRelationToString ¶
func EntityAndRelationToString(entityAndRelation *base.EntityAndRelation) string
EntityAndRelationToString -
func IsEntityAndSubjectEquals ¶
IsEntityAndSubjectEquals -
Types ¶
type EntityCollection ¶
type EntityCollection struct {
// contains filtered or unexported fields
}
EntityCollection entity collection.
func (*EntityCollection) Add ¶
func (e *EntityCollection) Add(entity *base.Entity)
Add new subject to collection.
func (*EntityCollection) CreateEntityIterator ¶
func (e *EntityCollection) CreateEntityIterator() IEntityIterator
CreateEntityIterator create entity iterator according to collection.
func (*EntityCollection) GetEntities ¶
func (e *EntityCollection) GetEntities() []*base.Entity
GetEntities -
type EntityIterator ¶
type EntityIterator struct {
// contains filtered or unexported fields
}
EntityIterator -
type IEntityCollection ¶
type IEntityCollection interface { Add(entity *base.Entity) CreateEntityIterator() IEntityIterator GetEntities() []*base.Entity }
IEntityCollection abstract entity collection.
func NewEntityCollection ¶
func NewEntityCollection(entities ...*base.Entity) IEntityCollection
NewEntityCollection create new subject collection.
type IEntityIterator ¶
IEntityIterator abstract subject iterator.
type ISubjectCollection ¶
type ISubjectCollection interface { Add(subject *base.Subject) CreateSubjectIterator() ISubjectIterator GetSubjects() []*base.Subject }
ISubjectCollection abstract subject collection.
func NewSubjectCollection ¶
func NewSubjectCollection(subjects ...*base.Subject) ISubjectCollection
NewSubjectCollection create new subject collection.
type ISubjectIterator ¶
ISubjectIterator abstract subject iterator.
type ITupleCollection ¶
type ITupleCollection interface { Add(tuple *base.Tuple) CreateTupleIterator() ITupleIterator GetTuples() []*base.Tuple }
ITupleCollection abstract subject collection.
type ITupleIterator ¶
ITupleIterator abstract tuple iterator.
type SubjectCollection ¶
type SubjectCollection struct {
// contains filtered or unexported fields
}
SubjectCollection subject collection.
func (*SubjectCollection) Add ¶
func (s *SubjectCollection) Add(subject *base.Subject)
Add new subject to collection.
func (*SubjectCollection) CreateSubjectIterator ¶
func (s *SubjectCollection) CreateSubjectIterator() ISubjectIterator
CreateSubjectIterator create subject iterator according to collection.
func (*SubjectCollection) GetSubjects ¶
func (s *SubjectCollection) GetSubjects() []*base.Subject
GetSubjects -
type SubjectIterator ¶
type SubjectIterator struct {
// contains filtered or unexported fields
}
SubjectIterator -
type TupleCollection ¶
type TupleCollection struct {
// contains filtered or unexported fields
}
TupleCollection tuple collection.
func NewTupleCollection ¶
func NewTupleCollection(tuples ...*base.Tuple) *TupleCollection
NewTupleCollection create new tuple collection.
func (*TupleCollection) Add ¶
func (t *TupleCollection) Add(tuple *base.Tuple)
Add new subject to collection.
func (*TupleCollection) CreateTupleIterator ¶
func (t *TupleCollection) CreateTupleIterator() ITupleIterator
CreateTupleIterator create tuple iterator according to collection.
type TupleIterator ¶
type TupleIterator struct {
// contains filtered or unexported fields
}
TupleIterator tuple iterator -