Documentation ¶
Index ¶
- func GeneratedCommentHeader(config Config) codejen.FileMapper
- func If[Input any](condition bool, innerJenny codejen.OneToMany[Input]) codejen.OneToMany[Input]
- func NoopImportSanitizer(s string) string
- func PathPrefixer(prefix string) codejen.FileMapper
- type BuildOptions
- type Config
- type Context
- func (context *Context) IsDisjunctionOfBuilders(def ast.Type) bool
- func (context *Context) LocateObject(pkg string, name string) (ast.Object, bool)
- func (context *Context) ResolveToBuilder(def ast.Type) bool
- func (context *Context) ResolveToComposableSlot(def ast.Type) (ast.Type, bool)
- func (context *Context) ResolveToStruct(def ast.Type) bool
- type DirectImportMap
- type ImportMapConfig
- type ImportMapOption
- type PackageTemplate
- type RepositoryTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratedCommentHeader ¶
func GeneratedCommentHeader(config Config) codejen.FileMapper
GeneratedCommentHeader produces a FileMapper that injects a comment header onto a codejen.File indicating the jenny or jennies that constructed the file.
func NoopImportSanitizer ¶
func PathPrefixer ¶
func PathPrefixer(prefix string) codejen.FileMapper
PathPrefixer returns a FileMapper that injects the provided path prefix to files passed through it.
Types ¶
type BuildOptions ¶
type BuildOptions struct {
Languages []string
}
type Config ¶
type Config struct { // Debug turns on or off the debugging mode. Debug bool // Types indicates whether types should be generated or not. Types bool // Builders indicates whether builders should be generated or not. Builders bool }
Config represents global configuration options, to be used by all jennies.
type Context ¶
func (*Context) IsDisjunctionOfBuilders ¶
func (*Context) LocateObject ¶
func (*Context) ResolveToComposableSlot ¶
type DirectImportMap ¶
type DirectImportMap struct { Imports *orderedmap.Map[string, string] // alias → importPath // contains filtered or unexported fields }
func NewDirectImportMap ¶
func NewDirectImportMap(opts ...ImportMapOption[DirectImportMap]) *DirectImportMap
func (DirectImportMap) IsIdentical ¶
func (im DirectImportMap) IsIdentical(aliasA string, aliasB string) bool
func (DirectImportMap) String ¶
func (im DirectImportMap) String() string
type ImportMapConfig ¶
type ImportMapOption ¶
type ImportMapOption[M any] func(importMap *ImportMapConfig[M])
func WithAliasSanitizer ¶
func WithAliasSanitizer[M any](sanitizer func(string) string) ImportMapOption[M]
func WithFormatter ¶
func WithFormatter[M any](formatter func(M) string) ImportMapOption[M]
func WithImportPathSanitizer ¶
func WithImportPathSanitizer[M any](sanitizer func(string) string) ImportMapOption[M]
type PackageTemplate ¶
func (PackageTemplate) Generate ¶
func (jenny PackageTemplate) Generate(context Context) (codejen.Files, error)
func (PackageTemplate) JennyName ¶
func (jenny PackageTemplate) JennyName() string
type RepositoryTemplate ¶
func (RepositoryTemplate) Generate ¶
func (jenny RepositoryTemplate) Generate(buildOpts BuildOptions) (codejen.Files, error)
func (RepositoryTemplate) JennyName ¶
func (jenny RepositoryTemplate) JennyName() string
Click to show internal directories.
Click to hide internal directories.