undgen

package
v0.0.0-...-5b643b5 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UndPathConversion = "github.com/ngicks/und/conversion"
	UndPathUndTag     = "github.com/ngicks/und/undtag"
	UndPathValidate   = "github.com/ngicks/und/validate"
)

Variables

View Source
var (
	UndTargetTypes = []imports.TargetType{
		UndTargetTypeOption,
		UndTargetTypeUnd,
		UndTargetTypeElastic,
		UndTargetTypeSliceUnd,
		UndTargetTypeSliceElastic,
	}
	UndTargetTypeOption = imports.TargetType{
		ImportPath: "github.com/ngicks/und/option",
		Name:       "Option",
	}
	UndTargetTypeUnd = imports.TargetType{
		ImportPath: "github.com/ngicks/und",
		Name:       "Und",
	}
	UndTargetTypeElastic = imports.TargetType{
		ImportPath: "github.com/ngicks/und/elastic",
		Name:       "Elastic",
	}
	UndTargetTypeSliceUnd = imports.TargetType{
		ImportPath: "github.com/ngicks/und/sliceund",
		Name:       "Und",
	}
	UndTargetTypeSliceElastic = imports.TargetType{
		ImportPath: "github.com/ngicks/und/sliceund/elastic",
		Name:       "Elastic",
	}
	UndTargetTypeConversionEmpty = imports.TargetType{
		ImportPath: "github.com/ngicks/und/conversion",
		Name:       "Empty",
	}
)
View Source
var ConstUnd = ConstSet{
	Imports: []imports.TargetImport{
		{
			Import: imports.Import{Path: "github.com/ngicks/und/option", Name: "option"},
			Types:  []string{"Option"},
		},
		{
			Import: imports.Import{Path: "github.com/ngicks/und", Name: "und"},
			Types:  []string{"Und"},
		},
		{
			Import: imports.Import{Path: "github.com/ngicks/und/elastic", Name: "elastic"},
			Types:  []string{"Elastic"},
		},
		{
			Import: imports.Import{Path: "github.com/ngicks/und/sliceund", Name: "sliceund"},
			Types:  []string{"Und"},
		},
		{
			Import: imports.Import{Path: "github.com/ngicks/und/sliceund/elastic", Name: "elastic"},
			Ident:  "sliceelastic",
			Types:  []string{"Elastic"},
		},
		{
			Import: imports.Import{Path: "github.com/ngicks/und/undtag", Name: "undtag"},
			Types:  []string{},
		},
		{
			Import: imports.Import{Path: "github.com/ngicks/und/validate", Name: "validate"},
			Types:  []string{},
		},
		{
			Import: imports.Import{Path: "github.com/ngicks/und/conversion", Name: "conversion"},
			Types:  []string{"Empty"},
		},
	},
	ConversionMethod: typematcher.CyclicConversionMethods{
		Reverse: "UndRaw",
		Convert: "UndPlain",
	},
	ValidatorMethod: typematcher.ErrorMethod{
		Name: "UndValidate",
	},
}

Functions

func GeneratePatcher

func GeneratePatcher(
	sourcePrinter *suffixwriter.Writer,
	verbose bool,
	pkg *packages.Package,
	extra []imports.TargetImport,
	targetTypeNames ...string,
) error

func GeneratePlain

func GeneratePlain(
	sourcePrinter *suffixwriter.Writer,
	verbose bool,
	pkgs []*packages.Package,
	extra []imports.TargetImport,
) error

func GenerateValidator

func GenerateValidator(
	sourcePrinter *suffixwriter.Writer,
	verbose bool,
	pkgs []*packages.Package,
	extra []imports.TargetImport,
) error

Types

type ConstSet

type ConstSet struct {
	Imports          []imports.TargetImport
	ConversionMethod typematcher.CyclicConversionMethods
	ValidatorMethod  typematcher.ErrorMethod
}

Directories

Path Synopsis
internal
testtargets/deeplynested
tests dependant and implementor
tests dependant and implementor

Jump to

Keyboard shortcuts

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