codegen

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 6 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 deprecated

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

Deprecated: Don't use this, deprecated next major version.

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