gengo

package
v0.0.0-...-b226945 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: BSD-2-Clause Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultPkgs

func DefaultPkgs() map[string]string

func Import

func Import(c *gen.Gen, name string) string

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 NewGen

func NewGen(pr *dom.Project, pkg, path string) *gen.Gen

func NewGenPkgs

func NewGenPkgs(pr *dom.Project, pkg, path string, pkgs map[string]string) *gen.Gen

func WriteLit

func WriteLit(g *gen.Gen, l *exp.Lit) error

WriteLit writes the native go literal for l to c or returns an error.

func WriteModel

func WriteModel(g *gen.Gen, m *dom.Model) (err error)

WriteModel writes a type declaration for bits, enum and rec types. For bits and enum types the declaration includes the constant declarations.

func WriteSchema

func WriteSchema(g *gen.Gen, s *dom.Schema) error

WriteSchame writes the models with package and import declarations.

func WriteSchemaFile

func WriteSchemaFile(g *gen.Gen, name string, s *dom.Schema) error

func WriteType

func WriteType(g *gen.Gen, t typ.Type) error

WriteType writes the native go type for t to c or returns an error.

func WriteVal

func WriteVal(g *gen.Gen, t typ.Type, v lit.Val) error

WriteLit writes the native go literal for l to c or returns an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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