relmod

package
Version: v0.456.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alias

type Alias struct {
	AppName   []string
	TypeName  string
	AliasType interface{} // Type*
}

type Annotations

type Annotations struct {
	App   []AppAnnotation       `arrai:",unordered"`
	Mixin []MixinAnnotation     `arrai:",unordered"`
	Ep    []EndpointAnnotation  `arrai:",unordered"`
	Param []ParamAnnotation     `arrai:",unordered"`
	Stmt  []StatementAnnotation `arrai:",unordered"`
	Event []EventAnnotation     `arrai:",unordered"`
	Type  []TypeAnnotation      `arrai:",unordered"`
	Field []FieldAnnotation     `arrai:",unordered"`
	View  []ViewAnnotation      `arrai:",unordered"`
}

type App

type App struct {
	AppName      []string
	AppLongName  string
	AppDocstring string
}

type AppAnnotation

type AppAnnotation struct {
	AppName      []string
	AppAnnoName  string
	AppAnnoValue interface{} // string, number, array of self
}

type AppContext

type AppContext struct {
	AppName []string
	AppSrc  SourceContext
	AppSrcs []SourceContext
}

type AppTag

type AppTag struct {
	AppName []string
	AppTag  string
}

TAGS

type Endpoint

type Endpoint struct {
	AppName     []string
	EpName      string
	EpLongName  string
	EpDocstring string
	EpEvent     EndpointEvent `arrai:",zeroempty"`
	Rest        Rest          `arrai:",zeroempty"`
}

type EndpointAnnotation

type EndpointAnnotation struct {
	AppName     []string
	EpName      string
	EpAnnoName  string
	EpAnnoValue interface{} // string, number, array of self
}

type EndpointContext

type EndpointContext struct {
	AppName []string
	EpName  string
	EpSrc   SourceContext
	EpSrcs  []SourceContext
}

type EndpointEvent

type EndpointEvent struct {
	AppName   EndpointEventAppName
	EventName string
}

type EndpointEventAppName

type EndpointEventAppName struct {
	Part []string
}

type EndpointTag

type EndpointTag struct {
	AppName []string
	EpName  string
	EpTag   string
}

type Enum

type Enum struct {
	AppName   []string
	EnumItems map[string]int64
	TypeName  string
}

type Event

type Event struct {
	AppName   []string
	EventName string
}

type EventAnnotation

type EventAnnotation struct {
	AppName        []string
	EventName      string
	EventAnnoName  string
	EventAnnoValue interface{} // string, number, array of self
}

type EventContext

type EventContext struct {
	AppName   []string
	EventName string
	EventSrc  SourceContext
	EventSrcs []SourceContext
}

type EventTag

type EventTag struct {
	AppName   []string
	EventName string
	EventTag  string
}

type Field

type Field struct {
	AppName         []string
	TypeName        string
	FieldName       string
	FieldOpt        bool
	FieldType       interface{}     // Type*
	FieldConstraint FieldConstraint `arrai:",zeroempty"`
}

type FieldAnnotation

type FieldAnnotation struct {
	AppName        []string
	TypeName       string
	FieldName      string
	FieldAnnoName  string
	FieldAnnoValue interface{} // string, number, array of self
}

type FieldConstraint

type FieldConstraint struct {
	Length    FieldConstraintLength
	Precision int32
	Scale     int32
}

type FieldConstraintLength

type FieldConstraintLength struct {
	Min int64
	Max int64
}

type FieldContext

type FieldContext struct {
	AppName   []string
	TypeName  string
	FieldName string
	FieldSrc  SourceContext
	FieldSrcs []SourceContext
}

type FieldTag

type FieldTag struct {
	AppName   []string
	TypeName  string
	FieldName string
	FieldTag  string
}

type Location

type Location struct {
	Line int
	Col  int
}

type Mixin

type Mixin struct {
	AppName   []string
	MixinName []string
}

type MixinAnnotation

type MixinAnnotation struct {
	AppName        []string
	MixinName      []string
	MixinAnnoName  string
	MixinAnnoValue interface{} // string, number, array of self
}

type MixinContext

type MixinContext struct {
	AppName   []string
	MixinName []string
	MixinSrc  SourceContext
	MixinSrcs []SourceContext
}

type MixinTag

type MixinTag struct {
	AppName   []string
	MixinName []string
	MixinTag  string
}

type Param

type Param struct {
	AppName    []string
	EpName     string
	ParamName  string
	ParamLoc   string // enum
	ParamIndex int
	ParamType  interface{} // Type*
	ParamOpt   bool
}

type ParamAnnotation

type ParamAnnotation struct {
	AppName        []string
	EpName         string
	ParamName      string
	ParamLoc       string // enum
	ParamIndex     int
	ParamAnnoName  string
	ParamAnnoValue interface{} // string, number, array of self
}

type ParamContext

type ParamContext struct {
	AppName    []string
	EpName     string
	ParamName  string
	ParamLoc   string // enum
	ParamIndex int
	ParamSrc   SourceContext
	ParamSrcs  []SourceContext
}

type ParamTag

type ParamTag struct {
	AppName    []string
	EpName     string
	ParamName  string
	ParamLoc   string // enum
	ParamIndex int
	ParamTag   string
}

type QueryParam

type QueryParam struct {
	Name string
	Type interface{} // Type*
}

type Rest

type Rest struct {
	Method     string // GET, PUT, POST, DELETE, PATCH
	Path       string
	QueryParam []QueryParam `arrai:"query_param,omitempty"`
	URLParam   []QueryParam `arrai:"url_param,omitempty"`
}

Backwards compatible. TODO: Design new structure.

type Schema

type Schema struct {
	App   []App       `arrai:",unordered"`
	Mixin []Mixin     `arrai:",unordered"`
	Ep    []Endpoint  `arrai:",unordered"`
	Param []Param     `arrai:",unordered"`
	Stmt  []Statement `arrai:",unordered"`
	Event []Event     `arrai:",unordered"`
	Type  []Type      `arrai:",unordered"`
	Field []Field     `arrai:",unordered"`
	Table []Table     `arrai:",unordered"`
	Alias []Alias     `arrai:",unordered"`
	Enum  []Enum      `arrai:",unordered"`
	View  []View      `arrai:",unordered"`
	Anno  Annotations
	Tag   Tags
	Src   SourceContexts
}

func Normalize

func Normalize(ctx context.Context, m *sysl.Module) (*Schema, error)

Normalize transforms a module into a relational model schema.

type SourceContext

type SourceContext struct {
	File  string
	Start Location
	End   Location
}

type SourceContexts

type SourceContexts struct {
	App   []AppContext       `arrai:",unordered"`
	Mixin []MixinContext     `arrai:",unordered"`
	Ep    []EndpointContext  `arrai:",unordered"`
	Param []ParamContext     `arrai:",unordered"`
	Stmt  []StatementContext `arrai:",unordered"`
	Event []EventContext     `arrai:",unordered"`
	Type  []TypeContext      `arrai:",unordered"`
	Field []FieldContext     `arrai:",unordered"`
	View  []ViewContext      `arrai:",unordered"`
}

type Statement

type Statement struct {
	AppName     []string
	EpName      string
	StmtIndex   []int
	StmtParent  StatementParent        `arrai:",zeroempty"`
	StmtAction  string                 `arrai:",zeroempty"`
	StmtCall    map[string]interface{} `arrai:",zeroempty"`
	StmtCond    map[string]interface{} `arrai:",zeroempty"`
	StmtLoop    map[string]interface{} `arrai:",zeroempty"`
	StmtLoopN   map[string]interface{} `arrai:",zeroempty"`
	StmtForeach map[string]interface{} `arrai:",zeroempty"`
	StmtAlt     map[string]interface{} `arrai:",zeroempty"`
	StmtGroup   map[string]interface{} `arrai:",zeroempty"`
	StmtRet     StatementReturn        `arrai:",zeroempty"`
}

type StatementAnnotation

type StatementAnnotation struct {
	AppName       []string
	EpName        string
	StmtAnnoName  string
	StmtAnnoValue interface{} // string, number, array of self
	StmtIndex     []int
}

type StatementContext

type StatementContext struct {
	AppName   []string
	EpName    string
	StmtIndex []int
	StmtSrc   SourceContext
	StmtSrcs  []SourceContext
}

type StatementParent

type StatementParent struct {
	AppName   []string
	EpName    string
	StmtIndex int
}

type StatementReturn

type StatementReturn struct {
	Status string
	Attr   StatementReturnAttrs
	Type   interface{} // Type*
}

type StatementReturnAttrs

type StatementReturnAttrs struct {
	Modifier []string
	Nvp      map[string]interface{}
}

type StatementTag

type StatementTag struct {
	AppName   []string
	EpName    string
	StmtIndex []int
	StmtTag   string
}

type Table

type Table struct {
	AppName  []string
	TypeName string
	Pk       []string
}

type Tags

type Tags struct {
	App   []AppTag       `arrai:",unordered"`
	Mixin []MixinTag     `arrai:",unordered"`
	Ep    []EndpointTag  `arrai:",unordered"`
	Param []ParamTag     `arrai:",unordered"`
	Stmt  []StatementTag `arrai:",unordered"`
	Event []EventTag     `arrai:",unordered"`
	Type  []TypeTag      `arrai:",unordered"`
	Field []FieldTag     `arrai:",unordered"`
	View  []ViewTag      `arrai:",unordered"`
}

type Type

type Type struct {
	AppName       []string
	TypeName      string
	TypeDocstring string
	TypeOpt       bool
}

type TypeAnnotation

type TypeAnnotation struct {
	AppName       []string
	TypeName      string
	TypeAnnoName  string
	TypeAnnoValue interface{} // string, number, array of self
}

type TypeContext

type TypeContext struct {
	AppName  []string
	TypeName string
	TypeSrc  SourceContext
	TypeSrcs []SourceContext
}

type TypePrimitive

type TypePrimitive struct {
	Primitive string
}

type TypeRef

type TypeRef struct {
	AppName  []string
	TypePath []string
}

type TypeSequence

type TypeSequence struct {
	Sequence interface{} // Type*
}

type TypeSet

type TypeSet struct {
	Set interface{} // Type*
}

type TypeTag

type TypeTag struct {
	AppName  []string
	TypeName string
	TypeTag  string
}

type TypeTuple

type TypeTuple struct {
	Tuple interface{} // TODO
}

type View

type View struct {
	AppName  []string
	ViewName string
	ViewType interface{} // Type*
}

type ViewAnnotation

type ViewAnnotation struct {
	AppName       []string
	ViewName      string
	ViewAnnoName  string
	ViewAnnoValue interface{} // string, number, array of self
}

type ViewContext

type ViewContext struct {
	AppName  []string
	ViewName string
	ViewSrc  SourceContext
	ViewSrcs []SourceContext
}

type ViewTag

type ViewTag struct {
	AppName  []string
	ViewName string
	ViewTag  string
}

Jump to

Keyboard shortcuts

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