tuple

package
v0.0.0-alpha5 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 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

This section is empty.

Types

type Entity

type Entity struct {
	Type string `json:"type"`
	ID   string `json:"id"`
}

Entity -

func (Entity) String

func (e Entity) String() string

String -

func (Entity) Validate

func (e Entity) Validate() (err error)

Validate -

type EntityAndRelation

type EntityAndRelation struct {
	Entity   Entity   `json:"entity"`
	Relation Relation `json:"relation"`
}

EntityAndRelation -

func (EntityAndRelation) String

func (e EntityAndRelation) String() string

String -

type EntityIterator

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

EntityIterator -

func NewEntityIterator

func NewEntityIterator(entities []*Entity) *EntityIterator

NewEntityIterator -

func (*EntityIterator) GetNext

func (u *EntityIterator) GetNext() *Entity

GetNext -

func (*EntityIterator) HasNext

func (u *EntityIterator) HasNext() bool

HasNext -

type IEntityIterator

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

type ISubjectIterator

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

type Relation

type Relation string

Relation -

func (Relation) IsComputed

func (r Relation) IsComputed() bool

IsComputed -

func (Relation) Split

func (r Relation) Split() (a []Relation)

Split -

func (Relation) String

func (r Relation) String() string

String -

type Subject

type Subject struct {
	Type     string   `json:"type"`
	ID       string   `json:"id"`
	Relation Relation `json:"relation,omitempty"`
}

Subject -

func (Subject) Equals

func (s Subject) Equals(v interface{}) bool

Equals -

func (Subject) IsUser

func (s Subject) IsUser() bool

IsUser -

func (Subject) IsValid

func (s Subject) IsValid() bool

IsValid -

func (Subject) String

func (s Subject) String() string

String -

func (Subject) Validate

func (s Subject) Validate() (err error)

Validate -

func (Subject) ValidateSubjectType

func (s Subject) ValidateSubjectType(relationTypes []string) (err errors.Error)

ValidateSubjectType -

type SubjectIterator

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

SubjectIterator -

func NewSubjectIterator

func NewSubjectIterator(subjects []*Subject) *SubjectIterator

NewSubjectIterator -

func (*SubjectIterator) GetNext

func (u *SubjectIterator) GetNext() *Subject

GetNext -

func (*SubjectIterator) HasNext

func (u *SubjectIterator) HasNext() bool

HasNext -

type Tuple

type Tuple struct {
	Entity   Entity   `json:"entity"`
	Relation Relation `json:"relation"`
	Subject  Subject  `json:"subject"`
}

Tuple -

func (Tuple) IsEntityAndSubjectEquals

func (r Tuple) IsEntityAndSubjectEquals() bool

IsEntityAndSubjectEquals -

func (Tuple) String

func (r Tuple) String() string

String -

Jump to

Keyboard shortcuts

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