generator

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UnmanagedName

func UnmanagedName(name string) string

Types

type Field

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

type FieldOptions

type FieldOptions struct {
	IsNative bool

	IsPointer              bool
	ArraySlice             *string
	IsArraySliceOfPointers bool
	// contains filtered or unexported fields
}

type Generator

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

func New

func New(pf *parser.ParsedFile) *Generator

func (*Generator) AddStruct

func (gen *Generator) AddStruct(name string, managedName string) *Struct

func (*Generator) NextId

func (gen *Generator) NextId() string

func (*Generator) Save

func (gen *Generator) Save() error

type SaveContext

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

func (*SaveContext) Save

func (sc *SaveContext) Save() error

func (*SaveContext) WriteHelpers added in v0.1.0

func (sc *SaveContext) WriteHelpers() error

func (*SaveContext) WriteImports

func (sc *SaveContext) WriteImports() error

func (*SaveContext) WriteLine

func (sc *SaveContext) WriteLine(format string, a ...any)

func (*SaveContext) WriteStructAllocator

func (sc *SaveContext) WriteStructAllocator(st *Struct) error

func (*SaveContext) WriteStructDeclaration

func (sc *SaveContext) WriteStructDeclaration(st *Struct) error

func (*SaveContext) WriteStructFieldsSetters

func (sc *SaveContext) WriteStructFieldsSetters(st *Struct) error

func (*SaveContext) WriteStructs

func (sc *SaveContext) WriteStructs() error

func (*SaveContext) WriteTemplate

func (sc *SaveContext) WriteTemplate(name string, code string, funcMap template.FuncMap, data any) error

type Struct

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

func (*Struct) AddField

func (gs *Struct) AddField(names []string, typeName string, tags parser.ParsedTags, opts FieldOptions)

Jump to

Keyboard shortcuts

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