gen

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: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Nogen

func Nogen(s *dom.Schema) bool

Types

type Gen

type Gen struct {
	bfr.P
	*dom.Project
	Pkg    string
	Target string
	Header string
	OpPrec int
	Pkgs   map[string]string
	Imports
}

Gen is the code generation context holding the buffer and additional information.

func (*Gen) Prec

func (g *Gen) Prec(prec int) (restore func())

func (*Gen) Prepend

func (g *Gen) Prepend(text, prefix string)

Prepend write each line in text prepended with prefix to the buffer. It strips the ascii whitespace bytes after the first linebreak, and tries to remove the same from each following line. If text starts with an empty line, that line is ignored.

type Imports

type Imports struct {
	List []string
}

Imports has a list of alphabetically sorted dependencies. A dependency can be any string recognized by the generator. For go imports the dependency is a package path.

func (*Imports) Add

func (i *Imports) Add(path string)

Add inserts path into the import list if not already present.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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