Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorLine(errIn error, genData string) error
- func GenerateByTmpl(params any, backendName string, funcs template.FuncMap, ...) ([]byte, *arerror.ErrGeneratorPhases)
- func GenerateFixtureTmpl(dstFile io.Writer, params octopus.FixturePkgData) *arerror.ErrGeneratorPhases
- func GenerateFromDir(params PkgData, backendObj backend.BackendDriver) (map[string][]byte, *arerror.ErrGeneratorPhases)
- type GenerateFile
- func Generate(appInfo string, cl ds.RecordPackage, linkObject map[string]ds.RecordPackage) (ret []GenerateFile, err error)
- func GenerateFixture(appInfo string, cl ds.RecordPackage, pkg string, pkgFixture string) ([]GenerateFile, error)
- func GenerateMeta(params MetaData) ([]GenerateFile, *arerror.ErrGeneratorFile)
- type MetaData
- type PkgData
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 GenerateByTmpl ¶
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 ¶
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
Click to show internal directories.
Click to hide internal directories.