Documentation ¶
Index ¶
- func LowerCamelCase(s string) string
- func LowerSnakeCase(s string) string
- func Register(g Generator)
- func Snippet(format string, args ...Args) func(s SnippetWriter)
- func UpperCamelCase(s string) string
- func UpperSnakeCase(s string) string
- type Args
- type Context
- type Dumper
- type Generator
- type GeneratorArgs
- type GeneratorCreator
- type GeneratorPostInit
- type SnippetWriter
- type ValueLitOpt
- type ValueLitOptFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LowerCamelCase ¶
func LowerSnakeCase ¶
func Snippet ¶
func Snippet(format string, args ...Args) func(s SnippetWriter)
func UpperCamelCase ¶
func UpperSnakeCase ¶
Types ¶
type Context ¶
type Context struct { PkgPaths map[string]bool Args *GeneratorArgs Universe gengotypes.Universe Package gengotypes.Package Tags map[string][]string }
func NewContext ¶
func NewContext(args *GeneratorArgs) (*Context, error)
type Dumper ¶
type Dumper struct {
// contains filtered or unexported fields
}
func (*Dumper) ValueLit ¶
func (d *Dumper) ValueLit(in interface{}, optFns ...ValueLitOptFn) string
type Generator ¶
type Generator interface { // Name generator name Name() string // New generator New() Generator // Init generator Init(*Context, GeneratorCreator) (Generator, error) // 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 GeneratorPostInit ¶
type GeneratorPostInit = func(g Generator, sw SnippetWriter) error
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 interface{}) string) ValueLitOptFn
func OnNamedType ¶
func OnNamedType(onNamedType func(v interface{}) (string, bool)) ValueLitOptFn
func SubValue ¶
func SubValue(sub bool) ValueLitOptFn
Click to show internal directories.
Click to hide internal directories.