tuple

package
v0.0.0-alpha8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2022 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ENTITY   = "%s:%s"
	RELATION = "#%s"
)
View Source
const (
	ELLIPSIS = "..."
)
View Source
const (
	SEPARATOR = "."
)
View Source
const (
	USER = "user"
)

Variables

This section is empty.

Functions

func AreSubjectsEqual

func AreSubjectsEqual(s1 *base.Subject, s2 *base.Subject) bool

AreSubjectsEqual -

func EntityAndRelationToString

func EntityAndRelationToString(entityAndRelation *base.EntityAndRelation) string

EntityAndRelationToString -

func EntityToString

func EntityToString(entity *base.Entity) string

EntityToString -

func IsEntityAndSubjectEquals

func IsEntityAndSubjectEquals(t *base.Tuple) bool

IsEntityAndSubjectEquals -

func IsRelationComputed

func IsRelationComputed(relation string) bool

IsRelationComputed -

func IsSubjectUser

func IsSubjectUser(subject *base.Subject) bool

IsSubjectUser -

func IsSubjectValid

func IsSubjectValid(subject *base.Subject) bool

IsSubjectValid -

func SplitRelation

func SplitRelation(relation string) (a []string)

SplitRelation -

func SubjectToString

func SubjectToString(subject *base.Subject) string

SubjectToString -

func ValidateSubject

func ValidateSubject(subject *base.Subject) error

ValidateSubject -

func ValidateSubjectType

func ValidateSubjectType(subject *base.Subject, relationTypes []string) (err error)

ValidateSubjectType -

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 -

func (*EntityIterator) GetNext

func (u *EntityIterator) GetNext() *base.Entity

GetNext -

func (*EntityIterator) HasNext

func (u *EntityIterator) HasNext() bool

HasNext -

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

type IEntityIterator interface {
	HasNext() bool
	GetNext() *base.Entity
}

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

type ISubjectIterator interface {
	HasNext() bool
	GetNext() *base.Subject
}

ISubjectIterator abstract subject iterator.

type ITupleCollection

type ITupleCollection interface {
	Add(tuple *base.Tuple)
	CreateTupleIterator() ITupleIterator
	GetTuples() []*base.Tuple
}

ITupleCollection abstract subject collection.

type ITupleIterator

type ITupleIterator interface {
	HasNext() bool
	GetNext() *base.Tuple
}

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 -

func (*SubjectIterator) GetNext

func (u *SubjectIterator) GetNext() *base.Subject

GetNext -

func (*SubjectIterator) HasNext

func (u *SubjectIterator) HasNext() bool

HasNext -

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.

func (*TupleCollection) GetTuples

func (t *TupleCollection) GetTuples() []*base.Tuple

GetTuples -

type TupleIterator

type TupleIterator struct {
	// contains filtered or unexported fields
}

TupleIterator tuple iterator -

func (*TupleIterator) GetNext

func (i *TupleIterator) GetNext() *base.Tuple

GetNext -

func (*TupleIterator) HasNext

func (i *TupleIterator) HasNext() bool

HasNext -

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL