schema

package
v0.0.0-alpha6 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: AGPL-3.0 Imports: 5 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"`
	Option    map[string]interface{} `json:"option"`
}

Entity -

func (Entity) GetAction

func (e Entity) GetAction(name string) (action Action, err errors.Error)

GetAction -

func (Entity) GetIdentifier

func (e Entity) GetIdentifier() string

GetIdentifier -

func (Entity) GetRelation

func (e Entity) GetRelation(name string) (relation Relation, err errors.Error)

GetRelation -

func (Entity) GetTable

func (e Entity) GetTable() string

GetTable -

func (Entity) ToGraph

func (e Entity) ToGraph() (g graph.Graph, error errors.Error)

ToGraph -

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"`
	Types  []string               `json:"type"`
	Option map[string]interface{} `json:"option"`
}

Relation -

func (Relation) GetColumn

func (r Relation) GetColumn() (string, bool)

GetColumn -

func (Relation) Type

func (r Relation) Type() string

Type -

type Relations

type Relations []Relation

func (Relations) GetRelationByName

func (r Relations) GetRelationByName(name string) (relation Relation, err error)

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 Entity, err errors.Error)

GetEntityByName -

func (Schema) ToGraph

func (s Schema) ToGraph() (g graph.Graph, error errors.Error)

ToGraph -

Jump to

Keyboard shortcuts

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