Documentation ¶
Index ¶
- Variables
- type BaseGen
- type Generator
- func (bg *Generator) GoDeclValue(val adlast.Decl) string
- func (in *Generator) GoEscape(n string) string
- func (in *Generator) GoImport(s string) (string, error)
- func (in *Generator) GoRegisterHelper(moduleName string, decl adlast.Decl) (string, error)
- func (bg *Generator) GoTexprValue(val adlast.TypeExpr, anns customtypes.MapMap[adlast.ScopedName, any]) string
- func (bg *Generator) GoValue(anns adlast.Annotations, te adlast.TypeExpr, val any) string
- func (*Generator) JsonEncode(val any) string
- func (in *Generator) ToTitle(s string) string
- func (in *Generator) WriteFile(rt *root.Root, modCodeGenPkg string, path string, noGoFmt bool, ...) error
- type SnResolver
- type SubTask
- type TemplateRenderer
- type TypeParam
- func (tp TypeParam) AddParam(newp string) TypeParam
- func (tp TypeParam) AddParams(newps ...string) TypeParam
- func (tp TypeParam) Has() bool
- func (tp TypeParam) LSide() string
- func (tp TypeParam) Last() string
- func (tp TypeParam) MarshalJSON() ([]byte, error)
- func (tp TypeParam) RSide() string
- func (tp TypeParam) TexprArgs() string
- func (tp TypeParam) TexprValues() string
- func (tp TypeParam) TpArgs() string
Constants ¶
This section is empty.
Variables ¶
View Source
var GoCustomTypeSN = adlast.Make_ScopedName(
"adlc.config.go_",
"GoCustomType",
)
View Source
var TypeParamConstraintListSN = adlast.Make_ScopedName("adlc.config.go_", "TypeParamConstraintList")
Functions ¶
This section is empty.
Types ¶
type BaseGen ¶
type BaseGen struct { Cli SubTask Resolver SnResolver ModulePath string MidPath string ModuleName string Imports goimports.Imports }
func NewBaseGen ¶
func (*BaseGen) GoType ¶
func (in *BaseGen) GoType( typeExpr adlast.TypeExpr, anns adlast.Annotations, ) goTypeExpr
func (*BaseGen) PrimitiveMap ¶
type Generator ¶
type Generator struct { *BaseGen Rr TemplateRenderer }
func (*Generator) GoRegisterHelper ¶
func (*Generator) GoTexprValue ¶
func (bg *Generator) GoTexprValue(val adlast.TypeExpr, anns customtypes.MapMap[adlast.ScopedName, any]) string
func (*Generator) JsonEncode ¶
type SnResolver ¶
type SnResolver func(sn adlast.ScopedName) (*adlast.Decl, bool)
type TemplateRenderer ¶
func (*TemplateRenderer) Bytes ¶
func (tr *TemplateRenderer) Bytes() []byte
Bytes returns the accumulated bytes.
func (*TemplateRenderer) Render ¶
func (tr *TemplateRenderer) Render(params any)
Render calls ExecuteTemplate to render to its buffer.
func (*TemplateRenderer) RenderTemplate ¶
func (tr *TemplateRenderer) RenderTemplate(name string, params any) error
type TypeParam ¶
func TypeParamsFromDecl ¶
func (TypeParam) MarshalJSON ¶
func (TypeParam) TexprValues ¶
Click to show internal directories.
Click to hide internal directories.