lang

package
v0.0.0-...-e95732d Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModFuncs

func ModFuncs(parent, cc string, sub ...string) []func(m *core.Module) *exec.Cmd

func SysFuncs

func SysFuncs(parent, cc string, sub ...string) []func(s *core.System) *exec.Cmd

Types

type Cmd

type Cmd[T core.Storable] struct {
	// contains filtered or unexported fields
}

func NewModCmd

func NewModCmd(parent string, scripts *Scripts) (cmd *Cmd[*core.Module])

func NewSysCmd

func NewSysCmd(parent string, scripts *Scripts) (cmd *Cmd[*core.System])

func (*Cmd[T]) Build

func (c *Cmd[T]) Build() []func(m T) *exec.Cmd

func (*Cmd[T]) Gen

func (c *Cmd[T]) Gen() []func(m T) *exec.Cmd

func (*Cmd[T]) Init

func (c *Cmd[T]) Init() []func(m T) *exec.Cmd

func (*Cmd[T]) Start

func (c *Cmd[T]) Start() []func(m T) *exec.Cmd

func (*Cmd[T]) Stop

func (c *Cmd[T]) Stop() []func(m T) *exec.Cmd

type CmdSet

type CmdSet struct {
	Mod *Cmd[*core.Module]
	Sys *Cmd[*core.System]
}

func NewCmdSet

func NewCmdSet(parent string, sysScripts, modScripts *Scripts) *CmdSet

type Entry

type Entry struct {
	Path     *template.Template
	Template *template.Template
	Children []*Entry
}

type Language

type Language struct {
	*CmdSet `yaml:"-"`
	Service string   `yaml:"service"`
	Name    string   `yaml:"name"`
	Scripts *Scripts `yaml:"scripts"`

	TypeMap  TypeMap `yaml:"type_map"`
	ArrayFmt string  `yaml:"array_fmt"`
	// contains filtered or unexported fields
}

func CreateLanguage

func CreateLanguage(name, parent string, sysScripts, modScripts *Scripts, fs *embed.FS, types TypeMap, arrayFmt string) *Language

func Fortran

func Fortran(parent string) *Language

func Go

func Go(parent string) *Language

func GraphQL

func GraphQL(parent string) *Language

func Protobuf

func Protobuf(parent string) *Language

func Python

func Python(parent string) *Language

func SQL

func SQL(parent string) *Language

func TypeScript

func TypeScript(parent string) *Language

func (*Language) CreateDecl

func (l *Language) CreateDecl(f core.Field) (s string)

func (*Language) FS

func (l *Language) FS() *embed.FS

func (*Language) InputDecl

func (l *Language) InputDecl(f core.Field) (s string)

func (*Language) InputString

func (l *Language) InputString(t core.Type) (s string)

func (*Language) MakeArray

func (l *Language) MakeArray(s string) string

func (*Language) TypeDecl

func (l *Language) TypeDecl(f core.Field) (s string)

func (*Language) TypeString

func (l *Language) TypeString(t core.Type) (s string)

func (*Language) UpdateDecl

func (l *Language) UpdateDecl(f core.Field) (s string)

type Scripts

type Scripts struct {
	WorkDir string            `yaml:"work_dir"`
	Map     map[string]string `yaml:"inline"`
}

type TemplateLoader

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

func NewLoader

func NewLoader(parent string, lang *Language) *TemplateLoader

func (*TemplateLoader) Load

func (l *TemplateLoader) Load() error

func (*TemplateLoader) Module

func (l *TemplateLoader) Module() []*Entry

func (*TemplateLoader) System

func (l *TemplateLoader) System() []*Entry

type TypeCrawler

type TypeCrawler struct {
	Types []*core.Model
	// contains filtered or unexported fields
}

TypeCrawler visits all types and generates functions to translate inputs into the correct type

func NewCrawler

func NewCrawler(l *Language, m *core.API) *TypeCrawler

func NewEntityCrawler

func NewEntityCrawler(l *Language, m *core.API) *TypeCrawler

func NewSQLQueryCrawler

func NewSQLQueryCrawler(l *Language, m *core.API) *TypeCrawler

func NewYamlCrawler

func NewYamlCrawler(l *Language, m *core.API) *TypeCrawler

func (*TypeCrawler) Crawl

func (c *TypeCrawler) Crawl() error

func (*TypeCrawler) String

func (c *TypeCrawler) String() string

func (*TypeCrawler) VisitType

func (c *TypeCrawler) VisitType(t core.Type) error

VisitType visits a type and generates functions to translate inputs into the correct type

type TypeMap

type TypeMap map[core.BaseType]string

Jump to

Keyboard shortcuts

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