tuple

package
v0.0.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: Apache-2.0 Imports: 4 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 ConvertEntity

func ConvertEntity(v string) (Entity, error)

ConvertEntity -

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 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 ConvertSubject

func ConvertSubject(v string) Subject

ConvertSubject -

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 -

type SubjectIterator

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

SubjectIterator -

func NewSubjectIterator

func NewSubjectIterator(subjects []*Subject) *SubjectIterator

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 string  `json:"relation"`
	Subject  Subject `json:"subject"`
}

Tuple -

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