Documentation ¶
Index ¶
- func DefaultPkgs() map[string]string
- func Import(c *gen.Gen, name string) string
- func NewGen(pr *dom.Project, pkg, path string) *gen.Gen
- func NewGenPkgs(pr *dom.Project, pkg, path string, pkgs map[string]string) *gen.Gen
- func WriteLit(g *gen.Gen, l *exp.Lit) error
- func WriteModel(g *gen.Gen, m *dom.Model) (err error)
- func WriteSchema(g *gen.Gen, s *dom.Schema) error
- func WriteSchemaFile(g *gen.Gen, name string, s *dom.Schema) error
- func WriteType(g *gen.Gen, t typ.Type) error
- func WriteVal(g *gen.Gen, t typ.Type, v lit.Val) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPkgs ¶
func Import ¶
Import takes a qualified name of the form 'pkg.Decl', looks up a path from context packages map if available, otherwise the name is used as path. If the package path is the same as the context package it returns the 'Decl' part. Otherwise it adds the package path to the import list and returns a substring starting with last package path segment: 'pkg.Decl'.
func NewGenPkgs ¶
func WriteModel ¶
WriteModel writes a type declaration for bits, enum and rec types. For bits and enum types the declaration includes the constant declarations.
func WriteSchema ¶
WriteSchame writes the models with package and import declarations.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.