generator

package
v0.0.0-...-2cd456a Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

BuildSteps that'll used for generation.

Functions

func Generate

func Generate(pattern []string, mapping []comments.Converter, config Config) (*jen.File, error)

Generate generates a jen.File containing converters.

Types

type Config

type Config struct {
	Name                   string
	PackagePath            string
	ExtendMethods          []string
	WorkingDir             string
	WrapErrors             bool
	IgnoreUnexportedFields bool
	MatchFieldsIgnoreCase  bool
}

Config the generate config.

type ParseExtendOptions

type ParseExtendOptions struct {
	// PkgPath where the extend methods are located. If it is empty, the package is same as the
	// ConverterInterface package and ConverterScope should be used for the lookup.
	PkgPath string
	// Scope of the ConverterInterface.
	ConverterScope *types.Scope
	// ConverterInterface to use - can be nil if its use is not allowed.
	ConverterInterface types.Type
	// NamePattern is the regexp pattern to search for within the PkgPath above or
	// (if PkgPath is empty) within the Scope.
	NamePattern *regexp.Regexp
}

ParseExtendOptions holds extend method options.

Jump to

Keyboard shortcuts

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