Documentation ¶
Index ¶
- Constants
- Variables
- func ImportGoPath(importPath string) string
- func IsGeneratorEnabled(g Generator, tags map[string][]string) bool
- func PkgImportPathAndExpose(s string) (string, string)
- func Register(g Generator)
- type Context
- type Dumper
- type Executor
- type Generator
- type GeneratorArgs
- type GeneratorCreator
- type GeneratorNewer
- type GeneratorPostInit
- type Name
- type Render
- type Snippet
- type SnippetBuild
- type SnippetWriter
- type Tags
- type ValueLitOpt
- type ValueLitOptFn
Constants ¶
View Source
const T = "__T__"
Variables ¶
View Source
var ( ErrSkip = errors.New("skip") ErrIgnore = errors.New("ignore") )
View Source
var ( UpperSnakeCase = camelcase.UpperSnakeCase LowerSnakeCase = camelcase.LowerSnakeCase UpperKebabCase = camelcase.UpperKebabCase LowerKebabCase = camelcase.LowerKebabCase UpperCamelCase = camelcase.UpperCamelCase LowerCamelCase = camelcase.LowerCamelCase )
Functions ¶
func ImportGoPath ¶
func PkgImportPathAndExpose ¶
Types ¶
type Executor ¶
type Executor interface {
Execute(ctx corecontext.Context, generators ...Generator) error
}
func NewContext ¶
func NewContext(args *GeneratorArgs) (Executor, error)
type Generator ¶
type Generator interface { // Name generator name Name() string // GenerateType do generate for each named type GenerateType(Context, *types.Named) error }
func GetRegisteredGenerators ¶
type GeneratorArgs ¶
type GeneratorCreator ¶
type GeneratorCreator interface {
Init(Context, Generator, ...GeneratorPostInit) (Generator, error)
}
type GeneratorNewer ¶
type GeneratorPostInit ¶
type GeneratorPostInit = func(g Generator, sw SnippetWriter) error
type Snippet ¶
func MapSnippet ¶
type SnippetBuild ¶
type SnippetBuild = func() Snippet
type SnippetWriter ¶
func NewSnippetWriter ¶
func NewSnippetWriter(w io.Writer, ns namer.NameSystems) SnippetWriter
type ValueLitOpt ¶
type ValueLitOptFn ¶
type ValueLitOptFn func(o *ValueLitOpt)
func OnInterface ¶
func OnInterface(onUnknown func(v any) string) ValueLitOptFn
func OnNamedType ¶
func OnNamedType(onNamedType func(v any) (string, bool)) ValueLitOptFn
func SubValue ¶
func SubValue(sub bool) ValueLitOptFn
Click to show internal directories.
Click to hide internal directories.