generator

package
v3.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const TemplateName = `ARPkgTemplate`

Variables

View Source
var BaseTemplateFuncs = template.FuncMap{
	"split":      strings.Split,
	"trimPrefix": strings.TrimPrefix,
	"hasPrefix":  strings.HasPrefix,
	"snakeCase":  textutil.ToSnakeCase,
}
View Source
var MetaTmpl string

Functions

func ErrorLine

func ErrorLine(errIn error, genData string) error

func GenerateByTmpl

func GenerateByTmpl(params any, backendName string, funcs template.FuncMap, templateName, tmpl string) ([]byte, *arerror.ErrGeneratorPhases)

func GenerateFixtureTmpl

func GenerateFixtureTmpl(dstFile io.Writer, params octopus.FixturePkgData) *arerror.ErrGeneratorPhases

func GenerateFromDir

func GenerateFromDir(params PkgData, backendObj backend.BackendDriver) (map[string][]byte, *arerror.ErrGeneratorPhases)

Types

type GenerateFile

type GenerateFile struct {
	Data    []byte
	Name    string
	Dir     string
	Backend ds.Backend
}

func Generate

func Generate(appInfo string, cl ds.RecordPackage, linkObject map[string]ds.RecordPackage) (ret []GenerateFile, err error)

func GenerateFixture

func GenerateFixture(appInfo string, cl ds.RecordPackage, pkg string, pkgFixture string) ([]GenerateFile, error)

func GenerateMeta

func GenerateMeta(params MetaData) ([]GenerateFile, *arerror.ErrGeneratorFile)

type MetaData

type MetaData struct {
	Namespaces []*ds.RecordPackage
	AppInfo    string
}

ToDo вынести meta в отдельный пакет, что бы не было мешанины, делать вместе с задачей по переосмыслению бекенда для генерации

type PkgData

type PkgData struct {
	ARPkg            string
	ARPkgTitle       string
	FieldList        []ds.FieldDeclaration
	FieldMap         map[string]int
	FieldObject      map[string]ds.FieldObject
	LinkedObject     map[string]ds.RecordPackage
	ProcInFieldList  []ds.ProcFieldDeclaration
	ProcOutFieldList []ds.ProcFieldDeclaration
	ServerConfKey    string
	EnableSelectAll  bool
	Container        ds.NamespaceDeclaration
	Indexes          []ds.IndexDeclaration
	Serializers      map[string]ds.SerializerDeclaration
	Mutators         map[string]ds.MutatorDeclaration
	Imports          []ds.ImportDeclaration
	Triggers         map[string]ds.TriggerDeclaration
	Flags            map[string]ds.FlagDeclaration
	AppInfo          string
}

func NewPkgData

func NewPkgData(appInfo string, cl ds.RecordPackage) PkgData

Jump to

Keyboard shortcuts

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