generator

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package generator is a package that defines how code should be generated.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateByType

func GenerateByType(opts GenerateOptions) ([]byte, error)

GenerateByType generates the code for the optional type.

func InitializeTemplates

func InitializeTemplates()

InitializeTemplates initializes the templates, should be called at the start of the main program loop.

Types

type GenerateOptions

type GenerateOptions struct {
	// TypeName is the name of the type to generate optional to.
	TypeName string
	// ExtCode is the extension code.
	ExtCode int
	// PackageName is the name of the package to generate to.
	PackageName string
	// Imports is the list of imports to add to the generated code.
	Imports []string
	// CustomMarshalFunc is the name of the custom marshal function.
	CustomMarshalFunc string
	// CustomUnmarshalFunc is the name of the custom unmarshal function.
	CustomUnmarshalFunc string
}

GenerateOptions is the options for the code generation.

Jump to

Keyboard shortcuts

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