codegen

package
v0.0.1-rc5 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: MIT Imports: 7 Imported by: 2

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