Documentation
¶
Overview ¶
Package gen is a generation run for one project: settings.xml and sdm.xml from the sdm folder, metadata from the database <jdbc url>, the result is the texts of DTO and DAO files, in Go, Python or C++ (see LangOf).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Langs = []Lang{Go, Python, Cpp}
Langs are the languages; the first is the default.
Functions ¶
func OpenMetadata ¶
OpenMetadata opens the database of <db url user pwd> (or <jdbc>, for cli/genharness). $PROJECT_DIR$ and ${project_loc} are the project folder, a relative SQLite path is relative to it too.
Types ¶
type Entry ¶
type Entry struct {
N int // number, from 1, in the order of declaration
sdmxml.Class
Path string // relative to the project, with '/'
Modified time.Time // zero: no file
}
Entry is a class of sdm.xml and its file.
type Lang ¶
type Lang string
Lang is the target language of a configuration.
func LangOf ¶
LangOf is the language of the sdm folder by its root file, as in the IDE plug-ins: python.dal is Python, cpp.dal is C++. Without them the folder is Go: sdmc never needed go.dal.
type Result ¶
type Result struct {
DtoDir, DaoDir string // relative to the project, as scope in settings.xml
Dto, Dao []File
}
func Run ¶
func Run(projectDir, sdmDir string, md meta.Metadata, only map[string]bool, progress Progress) (*Result, error)
Run generates the DTO and DAO of the project: all of them or only the classes of only (names, see Select). An error of a particular class goes to File.Err, a general error (settings, XML) to error. progress may be nil.