codegen

package
v0.0.0-...-ff90098 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFormattedGoSource

func NewFormattedGoSource(source io.WriterTo) io.WriterTo

func SnakeToCamel

func SnakeToCamel(str string) string

TODO handle this more gracefully

Types

type CodeBuilder

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

func NewCodeBuilder

func NewCodeBuilder() *CodeBuilder

func (*CodeBuilder) Embed

func (cb *CodeBuilder) Embed(template io.WriterTo)

func (*CodeBuilder) Line

func (cb *CodeBuilder) Line(format string, args ...interface{})

func (*CodeBuilder) PopIndent

func (cb *CodeBuilder) PopIndent()

func (*CodeBuilder) PushIndent

func (cb *CodeBuilder) PushIndent()

func (*CodeBuilder) WriteTo

func (cb *CodeBuilder) WriteTo(output io.Writer) (int64, error)

type FormattedGoSource

type FormattedGoSource struct {
	Source io.WriterTo
}

func (*FormattedGoSource) WriteTo

func (fgs *FormattedGoSource) WriteTo(output io.Writer) (int64, error)

type GoImports

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

func NewGoImports

func NewGoImports() *GoImports

func (*GoImports) GenericObj

func (imports *GoImports) GenericObj(
	name string,
	parameters ...fmt.Stringer,
) *genericImportObject

func (*GoImports) Obj

func (imports *GoImports) Obj(fullName string) *importObject

This supports accessing objects of the form:

*(\[\])*(\*)*)*(<full module path>\.)?<object>({})?

map objects are not supported

func (*GoImports) WriteTo

func (imports *GoImports) WriteTo(output io.Writer) (int64, error)

Jump to

Keyboard shortcuts

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