codegen

package
v0.0.1-rc6 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 7 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) GenAssist

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

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) P

func (g *CodeGen) P(args ...any) *CodeGen

P prints a line to the generated output. It converts each parameter to a string following the same rules as fmt.Print. It never inserts spaces between parameters.

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 WithDisableField

func WithDisableField(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