codegen

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 6 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CodeGen

type CodeGen struct {
	// contains filtered or unexported fields
}

func New

func New(md []*ens.EntityDescriptor, opts ...Option) *CodeGen

func (*CodeGen) Bytes

func (g *CodeGen) Bytes() []byte

Bytes returns the CodeBuf's buffer.

func (*CodeGen) FormatSource

func (g *CodeGen) FormatSource() ([]byte, error)

FormatSource return formats and adjusts imports contents of the CodeGen's buffer.

func (*CodeGen) GenDDL

func (g *CodeGen) GenDDL() *CodeGen

func (*CodeGen) GenMapper

func (g *CodeGen) GenMapper() *CodeGen

func (*CodeGen) GenModel

func (g *CodeGen) GenModel() *CodeGen

func (*CodeGen) GenRapier added in v0.0.3

func (g *CodeGen) GenRapier(modelImportPath string) *CodeGen

func (*CodeGen) Print

func (g *CodeGen) Print(a ...any) (n int, err error)

Print formats using the default formats for its operands and writes to the generated output. Spaces are added between operands when neither is a string. It returns the number of bytes written and any write error encountered.

func (*CodeGen) Printf

func (g *CodeGen) Printf(format string, a ...any) (n int, err error)

Printf formats according to a format specifier for its operands and writes to the generated output. It returns the number of bytes written and any write error encountered.

func (*CodeGen) Println

func (g *CodeGen) Println(a ...any) (n int, err error)

Fprintln formats using the default formats to the generated output. Spaces are always added between operands and a newline is appended. It returns the number of bytes written and any write error encountered.

func (*CodeGen) Write

func (g *CodeGen) Write(b []byte) (n int, err error)

Write appends the contents of p to the buffer,

type Option

type Option func(*CodeGen)

func WithByName

func WithByName(s string) Option

func WithDisableDocComment

func WithDisableDocComment(b bool) Option

func WithHasColumn

func WithHasColumn(b bool) Option

func WithOptions

func WithOptions(mp map[string]string) Option

func WithPackageName

func WithPackageName(s string) Option

func WithSkipColumns

func WithSkipColumns(mp map[string]struct{}) Option

func WithVersion

func WithVersion(version string) Option

Jump to

Keyboard shortcuts

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