Documentation
¶
Index ¶
- func GeneratedCommentHeader(config languages.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, opts ...PathPrefixerOption) codejen.FileMapper
- func TypeResolvingTemplateHelpers(context languages.Context) template.FuncMap
- type APIReference
- type APIReferenceCollector
- func (collector *APIReferenceCollector) BuilderMethod(builder ast.Builder, methodReference MethodReference)
- func (collector *APIReferenceCollector) FunctionsForPackage(pkg string) []FunctionReference
- func (collector *APIReferenceCollector) MethodsForBuilder(builder ast.Builder) []MethodReference
- func (collector *APIReferenceCollector) MethodsForObject(object ast.Object) []MethodReference
- func (collector *APIReferenceCollector) ObjectMethod(object ast.Object, methodReference MethodReference)
- func (collector *APIReferenceCollector) RegisterFunction(pkg string, functionReference FunctionReference)
- type APIReferenceFormatter
- type ArgumentReference
- type BuildOptions
- type DirectImportMap
- type FunctionReference
- type ImportMapConfig
- type ImportMapOption
- type MethodReference
- type PackageTemplate
- type PathPrefixerOption
- type RepositoryTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratedCommentHeader ¶
func GeneratedCommentHeader(config languages.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, opts ...PathPrefixerOption) codejen.FileMapper
PathPrefixer returns a FileMapper that injects the provided path prefix to files passed through it.
Types ¶
type APIReference ¶
type APIReference struct {
Collector *APIReferenceCollector
Language string
Formatter APIReferenceFormatter
Tmpl *template.Template
}
func (APIReference) JennyName ¶
func (jenny APIReference) JennyName() string
type APIReferenceCollector ¶
type APIReferenceCollector struct {
// contains filtered or unexported fields
}
func NewAPIReferenceCollector ¶
func NewAPIReferenceCollector() *APIReferenceCollector
func (*APIReferenceCollector) BuilderMethod ¶
func (collector *APIReferenceCollector) BuilderMethod(builder ast.Builder, methodReference MethodReference)
func (*APIReferenceCollector) FunctionsForPackage ¶
func (collector *APIReferenceCollector) FunctionsForPackage(pkg string) []FunctionReference
func (*APIReferenceCollector) MethodsForBuilder ¶
func (collector *APIReferenceCollector) MethodsForBuilder(builder ast.Builder) []MethodReference
func (*APIReferenceCollector) MethodsForObject ¶
func (collector *APIReferenceCollector) MethodsForObject(object ast.Object) []MethodReference
func (*APIReferenceCollector) ObjectMethod ¶
func (collector *APIReferenceCollector) ObjectMethod(object ast.Object, methodReference MethodReference)
func (*APIReferenceCollector) RegisterFunction ¶
func (collector *APIReferenceCollector) RegisterFunction(pkg string, functionReference FunctionReference)
type APIReferenceFormatter ¶
type APIReferenceFormatter struct {
KindName func(kind ast.Kind) string
FunctionSignature func(context languages.Context, function FunctionReference) string
ObjectName func(object ast.Object) string
ObjectDefinition func(context languages.Context, object ast.Object) string
MethodName func(method MethodReference) string
MethodSignature func(context languages.Context, method MethodReference) string
BuilderName func(builder ast.Builder) string
ConstructorSignature func(context languages.Context, builder ast.Builder) string
OptionName func(option ast.Option) string
OptionSignature func(context languages.Context, builder ast.Builder, option ast.Option) string
}
type ArgumentReference ¶
type BuildOptions ¶
type BuildOptions struct {
Languages []string
}
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 FunctionReference ¶
type FunctionReference struct {
Name string
Comments []string
Arguments []ArgumentReference
Return 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 MethodReference ¶
type PackageTemplate ¶
func (PackageTemplate) JennyName ¶
func (jenny PackageTemplate) JennyName() string
type PathPrefixerOption ¶
type PathPrefixerOption func(*pathPrefixerCfg)
func PrefixExcept ¶
func PrefixExcept(pathPrefix ...string) PathPrefixerOption
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.