schema

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: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	Name  string `json:"name"`
	Child Exp    `json:"child"`
}

Action -

type Child

type Child Exp

Child -

type ChildKind

type ChildKind string
const (
	LeafKind    ChildKind = "leaf"
	RewriteKind ChildKind = "rewrite"
)

func (ChildKind) String

func (o ChildKind) String() string

type Entity

type Entity struct {
	Name      string     `json:"name"`
	Relations []Relation `json:"relations"`
	Actions   []Action   `json:"actions"`
}

Entity -

func (Entity) GetAction

func (e Entity) GetAction(name string) Action

GetAction -

type Exp

type Exp interface {
	GetType() string
	GetKind() string
}

type Leaf

type Leaf struct {
	Exclusion bool     `json:"exclusion"`
	Type      LeafType `json:"type"` // tupleToUserSet or computedUserSet
	Value     string   `json:"value"`
}

Leaf -

func (Leaf) GetKind

func (Leaf) GetKind() string

GetKind -

func (Leaf) GetType

func (l Leaf) GetType() string

GetType -

type LeafType

type LeafType string

LeafType -

const (
	ComputedUserSetType LeafType = "computed_user_set"
	TupleToUserSetType  LeafType = "tuple_to_user_set"
)

func (LeafType) String

func (o LeafType) String() string

type OPType

type OPType string

OPType -

const (
	Union        OPType = "union"
	Intersection OPType = "intersection"
)

func (OPType) String

func (o OPType) String() string

type Relation

type Relation struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

Relation -

type Relations

type Relations []Relation

func (Relations) GetRelationByName

func (r Relations) GetRelationByName(name string) (relation Relation)

GetRelationByName -

type Rewrite

type Rewrite struct {
	Type     OPType  `json:"type"` // union or intersection
	Children []Child `json:"children"`
}

Rewrite -

func (Rewrite) GetKind

func (Rewrite) GetKind() string

GetKind -

func (Rewrite) GetType

func (r Rewrite) GetType() string

GetType -

type Schema

type Schema struct {
	Entities map[string]Entity `json:"entities"`
}

func NewSchema

func NewSchema(entities ...Entity) (schema Schema)

NewSchema -

func (Schema) GetEntityByName

func (s Schema) GetEntityByName(name string) Entity

GetEntityByName -

Jump to

Keyboard shortcuts

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