Documentation ¶
Index ¶
- Constants
- func IsDirectEntityReference(s RelationTypeStatement) bool
- type ActionStatement
- type EntityStatement
- type Expression
- type ExpressionStatement
- type ExpressionType
- type Identifier
- type InfixExpression
- type Node
- type Operator
- type RelationStatement
- type RelationTypeStatement
- type RelationalReferenceType
- type Schema
- func (sch *Schema) GetRelationReferenceIfExist(name string) ([]RelationTypeStatement, bool)
- func (sch *Schema) GetRelationalReferenceTypeIfExist(r string) (RelationalReferenceType, bool)
- func (sch *Schema) IsEntityReferenceExist(name string) bool
- func (sch *Schema) IsRelationReferenceExist(name string) bool
- func (sch *Schema) IsRelationalReferenceExist(name string) bool
- func (sch *Schema) SetActionReferences(r map[string]struct{})
- func (sch *Schema) SetEntityReferences(r map[string]struct{})
- func (sch *Schema) SetRelationReferences(r map[string][]RelationTypeStatement)
- func (sch *Schema) SetRelationalReferences(r map[string]RelationalReferenceType)
- func (sch *Schema) Validate() error
- type Statement
Constants ¶
const ( IDENTIFIER ExpressionType = "identifier" INFLIX ExpressionType = "inflix" AND Operator = "and" OR Operator = "or" ACTION RelationalReferenceType = "action" RELATION RelationalReferenceType = "relation" )
Variables ¶
This section is empty.
Functions ¶
func IsDirectEntityReference ¶
func IsDirectEntityReference(s RelationTypeStatement) bool
IsDirectEntityReference -
Types ¶
type ActionStatement ¶
type ActionStatement struct { Action token.Token // token.ACTION Name token.Token // token.IDENT ExpressionStatement Statement }
ActionStatement -
type EntityStatement ¶
type EntityStatement struct { Entity token.Token // token.ENTITY Name token.Token // token.IDENT RelationStatements []Statement ActionStatements []Statement }
EntityStatement -
type Expression ¶
type Expression interface { Node IsInfix() bool GetType() ExpressionType // contains filtered or unexported methods }
Expression -
type ExpressionStatement ¶
type ExpressionStatement struct {
Expression Expression
}
ExpressionStatement struct
type ExpressionType ¶
type ExpressionType string
type Identifier ¶
Identifier -
type InfixExpression ¶
type InfixExpression struct { Op token.Token // The operator token, e.g. and, or Left Expression Operator Operator Right Expression }
InfixExpression -
type RelationStatement ¶
type RelationStatement struct { Relation token.Token // token.RELATION Name token.Token // token.IDENT RelationTypes []RelationTypeStatement }
RelationStatement -
type RelationTypeStatement ¶
type RelationTypeStatement struct { Sign token.Token // token.SIGN Type token.Token // token.IDENT Relation token.Token // token.IDENT }
RelationTypeStatement -
type RelationalReferenceType ¶
type RelationalReferenceType string
type Schema ¶
type Schema struct { Statements []Statement // contains filtered or unexported fields }
Schema - it contains all statements
func (*Schema) GetRelationReferenceIfExist ¶
func (sch *Schema) GetRelationReferenceIfExist(name string) ([]RelationTypeStatement, bool)
GetRelationReferenceIfExist - it returns the relation reference
func (*Schema) GetRelationalReferenceTypeIfExist ¶
func (sch *Schema) GetRelationalReferenceTypeIfExist(r string) (RelationalReferenceType, bool)
GetRelationalReferenceTypeIfExist - it returns the relational reference type
func (*Schema) IsEntityReferenceExist ¶
IsEntityReferenceExist - it checks if the entity reference exists
func (*Schema) IsRelationReferenceExist ¶
IsRelationReferenceExist - it checks if the relation reference exists
func (*Schema) IsRelationalReferenceExist ¶
IsRelationalReferenceExist - it checks if the relational reference exists
func (*Schema) SetActionReferences ¶
SetActionReferences - it contains action references
func (*Schema) SetEntityReferences ¶
SetEntityReferences - it contains entity references
func (*Schema) SetRelationReferences ¶
func (sch *Schema) SetRelationReferences(r map[string][]RelationTypeStatement)
SetRelationReferences - it contains relation references
func (*Schema) SetRelationalReferences ¶
func (sch *Schema) SetRelationalReferences(r map[string]RelationalReferenceType)
SetRelationalReferences it contains action and relation references