Documentation
¶
Index ¶
- Variables
- func AnnotationForType[T Annotation](pg *Program, def TypeDef) T
- func SplitFirstRune(s string) (rune, string)
- type AggregateRootAnnotation
- func (s *AggregateRootAnnotation) Alias() string
- func (s *AggregateRootAnnotation) Name() string
- func (s *AggregateRootAnnotation) Pos() Pos
- func (s *AggregateRootAnnotation) SetAlias(alias string)
- func (s *AggregateRootAnnotation) SetPos(pos Pos)
- func (s *AggregateRootAnnotation) SetTypeDef(typeDef TypeDef)
- func (s *AggregateRootAnnotation) TypeDef() TypeDef
- type Annotation
- type AssignStmt
- type BaseType
- func (b *BaseType) AsResolvedType() *ResolvedType
- func (b *BaseType) Clone() TypeDef
- func (b *BaseType) Comment() *Comment
- func (b *BaseType) Kind() Kind
- func (b *BaseType) Name() Identifier
- func (b *BaseType) Pkg() *Package
- func (b *BaseType) SetKind(base Kind)
- func (b *BaseType) SetName(name Identifier)
- func (b *BaseType) SetPkg(pkg *Package)
- func (b *BaseType) SetTypeParams(typeParams []*ResolvedType)
- type BinaryExpr
- type BinaryExprOp
- type BlockStmt
- type BoundedContextAnnotation
- func (s *BoundedContextAnnotation) Alias() string
- func (s *BoundedContextAnnotation) Name() string
- func (s *BoundedContextAnnotation) Pkg() *Package
- func (s *BoundedContextAnnotation) Pos() Pos
- func (s *BoundedContextAnnotation) SetAlias(alias string)
- func (s *BoundedContextAnnotation) SetPkg(pkg *Package)
- func (s *BoundedContextAnnotation) SetPos(pos Pos)
- type CallExpr
- type Comment
- func (c *Comment) AddLines(lines ...*CommentLine)
- func (c *Comment) AddMacros(macros ...*MacroInvocation)
- func (c *Comment) Lines() []*CommentLine
- func (c *Comment) Macros() []*MacroInvocation
- func (c *Comment) SetLines(lines []*CommentLine)
- func (c *Comment) SetMacros(macros []*MacroInvocation)
- func (c *Comment) String() string
- type CommentLine
- type DistinctType
- func (d *DistinctType) AsResolvedType() *ResolvedType
- func (d *DistinctType) Clone() TypeDef
- func (d *DistinctType) Comment() *Comment
- func (d *DistinctType) Methods() []*Func
- func (d *DistinctType) Name() Identifier
- func (d *DistinctType) Pkg() *Package
- func (d *DistinctType) SetComment(comment *Comment)
- func (d *DistinctType) SetMethods(methods []*Func)
- func (d *DistinctType) SetName(name Identifier)
- func (d *DistinctType) SetPkg(pkg *Package)
- func (d *DistinctType) SetTypeParams(typeParams []*ResolvedType)
- func (d *DistinctType) SetTypes(types []*ResolvedType)
- func (d *DistinctType) SetUnderlying(underlying TypeDef)
- func (d *DistinctType) SetVisibility(visibility Visibility)
- func (d *DistinctType) TypeParams() []*ResolvedType
- func (d *DistinctType) Types() []*ResolvedType
- func (d *DistinctType) Underlying() TypeDef
- func (d *DistinctType) Visibility() Visibility
- type DomainEventAnnotation
- func (s *DomainEventAnnotation) Alias() string
- func (s *DomainEventAnnotation) Name() string
- func (s *DomainEventAnnotation) Pos() Pos
- func (s *DomainEventAnnotation) SetAlias(alias string)
- func (s *DomainEventAnnotation) SetPos(pos Pos)
- func (s *DomainEventAnnotation) SetTypeDef(typeDef TypeDef)
- func (s *DomainEventAnnotation) TypeDef() TypeDef
- type DomainServiceAnnotation
- func (s *DomainServiceAnnotation) Alias() string
- func (s *DomainServiceAnnotation) Name() string
- func (s *DomainServiceAnnotation) Pos() Pos
- func (s *DomainServiceAnnotation) SetAlias(alias string)
- func (s *DomainServiceAnnotation) SetPos(pos Pos)
- func (s *DomainServiceAnnotation) SetTypeDef(typeDef TypeDef)
- func (s *DomainServiceAnnotation) TypeDef() TypeDef
- type EntityAnnotation
- func (s *EntityAnnotation) Alias() string
- func (s *EntityAnnotation) Name() string
- func (s *EntityAnnotation) Pos() Pos
- func (s *EntityAnnotation) SetAlias(alias string)
- func (s *EntityAnnotation) SetPos(pos Pos)
- func (s *EntityAnnotation) SetTypeDef(typeDef TypeDef)
- func (s *EntityAnnotation) TypeDef() TypeDef
- type ErrorWithPos
- type Expr
- type Field
- func (f *Field) Comment() *Comment
- func (f *Field) Name() Identifier
- func (f *Field) PutTag(key, value string)
- func (f *Field) SetComment(comment *Comment)
- func (f *Field) SetName(name Identifier)
- func (f *Field) SetTags(tags map[string]string)
- func (f *Field) SetTypeDef(typeDef *ResolvedType)
- func (f *Field) SetVisibility(visibility Visibility)
- func (f *Field) Tags() map[string]string
- func (f *Field) TypeDef() *ResolvedType
- func (f *Field) Visibility() Visibility
- type File
- func (f *File) AbsolutePath() string
- func (f *File) AddImport(identifier Identifier, qualifier PkgImportQualifier)
- func (f *File) AddTypeDefs(typeDefs ...TypeDef)
- func (f *File) Comment() *Comment
- func (f *File) Generated() bool
- func (f *File) Import(src *File)
- func (f *File) Imports() map[Identifier]PkgImportQualifier
- func (f *File) MimeType() MimeType
- func (f *File) Modified() bool
- func (f *File) Name() string
- func (f *File) Path() string
- func (f *File) Pkg() *Package
- func (f *File) Preamble() *Comment
- func (f *File) RawBytes() []byte
- func (f *File) SetComment(comment *Comment)
- func (f *File) SetGenerated(generated bool)
- func (f *File) SetMimeType(mimeType MimeType)
- func (f *File) SetModified(modified bool)
- func (f *File) SetName(name string)
- func (f *File) SetPath(path string)
- func (f *File) SetPkg(pkg *Package)
- func (f *File) SetPreamble(preamble *Comment)
- func (f *File) SetRawBytes(rawBytes []byte)
- func (f *File) SetTypeDefs(typeDefs []TypeDef)
- func (f *File) TypeDefs() []TypeDef
- type Func
- func (f *Func) AddArgs(args ...*Param)
- func (f *Func) AddResults(results ...*Param)
- func (f *Func) AddTypeParams(typeParams ...*ResolvedType)
- func (f *Func) Args() []*Param
- func (f *Func) AsResolvedType() *ResolvedType
- func (f *Func) Body() *BlockStmt
- func (f *Func) Clone() TypeDef
- func (f *Func) Comment() *Comment
- func (f *Func) Name() Identifier
- func (f *Func) Pkg() *Package
- func (f *Func) Receiver() *Param
- func (f *Func) Results() []*Param
- func (f *Func) SetArgs(args []*Param)
- func (f *Func) SetBody(body *BlockStmt)
- func (f *Func) SetComment(comment *Comment)
- func (f *Func) SetName(name Identifier)
- func (f *Func) SetPkg(pkg *Package)
- func (f *Func) SetReceiver(receiver *Param)
- func (f *Func) SetResults(results []*Param)
- func (f *Func) SetTypeParams(typeParams []*ResolvedType)
- func (f *Func) SetVisibility(visibility Visibility)
- func (f *Func) TypeParams() []*ResolvedType
- func (f *Func) Visibility() Visibility
- type Identifier
- type IfStmt
- type Interface
- func (u *Interface) AddMethod(method *Func)
- func (u *Interface) AddTypes(types ...*ResolvedType)
- func (u *Interface) AsResolvedType() *ResolvedType
- func (u *Interface) Clone() TypeDef
- func (u *Interface) Comment() *Comment
- func (u *Interface) Methods() []*Func
- func (u *Interface) Name() Identifier
- func (u *Interface) Pkg() *Package
- func (u *Interface) SetComment(comment *Comment)
- func (u *Interface) SetMethods(methods []*Func)
- func (u *Interface) SetName(name Identifier)
- func (u *Interface) SetPkg(pkg *Package)
- func (u *Interface) SetTypeParams(typeParams []*ResolvedType)
- func (u *Interface) SetTypes(types []*ResolvedType)
- func (u *Interface) SetVisibility(visibility Visibility)
- func (u *Interface) Types() []*ResolvedType
- func (u *Interface) Visibility() Visibility
- type Kind
- type MacroInvocation
- type MacroName
- type MangeledName
- type MimeType
- type MutPtr
- func (m *MutPtr) AsResolvedType() *ResolvedType
- func (m *MutPtr) Comment() []*CommentLine
- func (m *MutPtr) Macros() []*MacroInvocation
- func (m *MutPtr) Name() Identifier
- func (m *MutPtr) Pkg() *Package
- func (m *MutPtr) SetComment(comment []*CommentLine)
- func (m *MutPtr) SetMacros(macros []*MacroInvocation)
- func (m *MutPtr) SetPkg(pkg *Package)
- func (m *MutPtr) SetTypeDef(typeDef TypeDef)
- func (m *MutPtr) TypeDef() TypeDef
- type Package
- func (p *Package) AddFiles(files ...*File)
- func (p *Package) AddTypeDefs(typeDefs ...TypeDef)
- func (p *Package) AsResolvedType() *ResolvedType
- func (p *Package) Clone() TypeDef
- func (p *Package) Comment() *Comment
- func (p *Package) Files() []*File
- func (p *Package) Macros() []*MacroInvocation
- func (p *Package) Name() Identifier
- func (p *Package) Pkg() *Package
- func (p *Package) Qualifier() PkgImportQualifier
- func (p *Package) SetComment(comment *Comment)
- func (p *Package) SetFiles(files []*File)
- func (p *Package) SetName(name Identifier)
- func (p *Package) SetQualifier(qualifier PkgImportQualifier)
- func (p *Package) SetTypeComments(typeComments map[MangeledName]*Comment)
- func (p *Package) SetTypeDefs(typeDefs []TypeDef)
- func (p *Package) SetTypeParams(typeParams []*ResolvedType)
- func (p *Package) TypeComments() map[MangeledName]*Comment
- func (p *Package) TypeDefs() []TypeDef
- type Param
- type PermissionAnnotation
- func (p *PermissionAnnotation) PermissionID() string
- func (p *PermissionAnnotation) Pos() Pos
- func (p *PermissionAnnotation) SetPermissionID(permissionID string)
- func (p *PermissionAnnotation) SetPos(pos Pos)
- func (p *PermissionAnnotation) SetTypeDef(typeDef TypeDef)
- func (p *PermissionAnnotation) TypeDef() TypeDef
- type PkgImportQualifier
- type PkgName
- type Pos
- type Program
- func (p *Program) AddAnnotations(annotations ...Annotation)
- func (p *Program) AddPackage(pkg *Package)
- func (p *Program) Annotations() []Annotation
- func (p *Program) MustResolveSimple(path, ident string) *ResolvedType
- func (p *Program) PackageByPath(q PkgImportQualifier) (*Package, bool)
- func (p *Program) Packages() []*Package
- func (p *Program) Path() string
- func (p *Program) SetAnnotations(annotations []Annotation)
- func (p *Program) SetPath(path string)
- func (p *Program) TypeDef(ref *TypeRef) (TypeDef, bool)
- type ProjectAnnotation
- func (s *ProjectAnnotation) Alias() string
- func (s *ProjectAnnotation) Name() string
- func (s *ProjectAnnotation) Pkg() *Package
- func (s *ProjectAnnotation) Pos() Pos
- func (s *ProjectAnnotation) SetAlias(alias string)
- func (s *ProjectAnnotation) SetPkg(pkg *Package)
- func (s *ProjectAnnotation) SetPos(pos Pos)
- type RawStmt
- type RepositoryAnnotation
- type ResolvedType
- func (r *ResolvedType) AddParams(params ...*ResolvedType)
- func (r *ResolvedType) AsTypeRef() *TypeRef
- func (r *ResolvedType) Name() Identifier
- func (r *ResolvedType) Params() []*ResolvedType
- func (r *ResolvedType) Pkg() *Package
- func (r *ResolvedType) Pointer() bool
- func (r *ResolvedType) SetName(name Identifier)
- func (r *ResolvedType) SetParams(params []*ResolvedType)
- func (r *ResolvedType) SetPkg(pkg *Package)
- func (r *ResolvedType) SetPointer(pointer bool)
- func (r *ResolvedType) SetTypeDef(typeDef TypeDef)
- func (r *ResolvedType) SetTypeParam(typeParam bool)
- func (r *ResolvedType) TypeDef() TypeDef
- func (r *ResolvedType) TypeParam() bool
- type ReturnStmt
- type SelectorExpr
- type Statement
- type StrLit
- type Struct
- func (s *Struct) AddFields(fields ...*Field)
- func (s *Struct) AddMethods(methods ...*Func)
- func (s *Struct) AddTypeParams(typeParams ...*ResolvedType)
- func (s *Struct) AsResolvedType() *ResolvedType
- func (s *Struct) Clone() TypeDef
- func (s *Struct) Comment() *Comment
- func (s *Struct) Fields() []*Field
- func (s *Struct) Methods() []*Func
- func (s *Struct) Name() Identifier
- func (s *Struct) Pkg() *Package
- func (s *Struct) SetComment(comment *Comment)
- func (s *Struct) SetFields(fields []*Field)
- func (s *Struct) SetMethods(methods []*Func)
- func (s *Struct) SetName(name Identifier)
- func (s *Struct) SetPkg(pkg *Package)
- func (s *Struct) SetTypeParams(typeParams []*ResolvedType)
- func (s *Struct) SetTypes(types []*ResolvedType)
- func (s *Struct) SetVisibility(visibility Visibility)
- func (s *Struct) TypeParams() []*ResolvedType
- func (s *Struct) Types() []*ResolvedType
- func (s *Struct) Visibility() Visibility
- type TypeDef
- type TypeParam
- func (t *TypeParam) AsResolvedType() *ResolvedType
- func (t *TypeParam) Clone() TypeDef
- func (t *TypeParam) Comment() *Comment
- func (t *TypeParam) Name() Identifier
- func (t *TypeParam) Pkg() *Package
- func (t *TypeParam) SetName(name Identifier)
- func (t *TypeParam) SetPkg(pkg *Package)
- func (t *TypeParam) SetTypeParams(typeParams []*ResolvedType)
- type TypeRef
- type Union
- func (u *Union) AddTypes(types ...*ResolvedType)
- func (u *Union) AsResolvedType() *ResolvedType
- func (u *Union) Clone() TypeDef
- func (u *Union) Comment() *Comment
- func (u *Union) File() *File
- func (u *Union) Name() Identifier
- func (u *Union) Pkg() *Package
- func (u *Union) SetComment(comment *Comment)
- func (u *Union) SetFile(file *File)
- func (u *Union) SetName(name Identifier)
- func (u *Union) SetPkg(pkg *Package)
- func (u *Union) SetTypeParams(typeParams []*ResolvedType)
- func (u *Union) SetTypes(types []*ResolvedType)
- func (u *Union) SetVisibility(visibility Visibility)
- func (u *Union) Types() []*ResolvedType
- func (u *Union) Visibility() Visibility
- type UseCaseAnnotation
- func (s *UseCaseAnnotation) Alias() string
- func (s *UseCaseAnnotation) Fn() *Func
- func (s *UseCaseAnnotation) Name() string
- func (s *UseCaseAnnotation) Pos() Pos
- func (s *UseCaseAnnotation) SetAlias(alias string)
- func (s *UseCaseAnnotation) SetFn(fn *Func)
- func (s *UseCaseAnnotation) SetPos(pos Pos)
- func (s *UseCaseAnnotation) TypeDef() TypeDef
- type ValueAnnotation
- func (s *ValueAnnotation) Alias() string
- func (s *ValueAnnotation) Name() string
- func (s *ValueAnnotation) Pos() Pos
- func (s *ValueAnnotation) SetAlias(alias string)
- func (s *ValueAnnotation) SetPos(pos Pos)
- func (s *ValueAnnotation) SetTypeDef(typeDef TypeDef)
- func (s *ValueAnnotation) TypeDef() TypeDef
- type Visibility
Constants ¶
This section is empty.
Variables ¶
var MacroRegex = regexp.MustCompile(`#\[.+\]`)
Functions ¶
func AnnotationForType ¶
func AnnotationForType[T Annotation](pg *Program, def TypeDef) T
func SplitFirstRune ¶
Types ¶
type AggregateRootAnnotation ¶
type AggregateRootAnnotation struct {
// contains filtered or unexported fields
}
func NewAggregateRootAnnotation ¶
func NewAggregateRootAnnotation(alias string, pos Pos, def TypeDef) *AggregateRootAnnotation
func (*AggregateRootAnnotation) Alias ¶
func (s *AggregateRootAnnotation) Alias() string
func (*AggregateRootAnnotation) Name ¶
func (s *AggregateRootAnnotation) Name() string
func (*AggregateRootAnnotation) Pos ¶
func (s *AggregateRootAnnotation) Pos() Pos
func (*AggregateRootAnnotation) SetAlias ¶
func (s *AggregateRootAnnotation) SetAlias(alias string)
func (*AggregateRootAnnotation) SetPos ¶
func (s *AggregateRootAnnotation) SetPos(pos Pos)
func (*AggregateRootAnnotation) SetTypeDef ¶
func (s *AggregateRootAnnotation) SetTypeDef(typeDef TypeDef)
func (*AggregateRootAnnotation) TypeDef ¶
func (s *AggregateRootAnnotation) TypeDef() TypeDef
type Annotation ¶
type Annotation interface {
// contains filtered or unexported methods
}
type AssignStmt ¶
type AssignStmt struct {
// contains filtered or unexported fields
}
func NewAssignStmt ¶
func NewAssignStmt(with func(assignStmt *AssignStmt)) *AssignStmt
func (*AssignStmt) AddLhs ¶
func (a *AssignStmt) AddLhs(lhs ...Expr)
func (*AssignStmt) AddRhs ¶
func (a *AssignStmt) AddRhs(rhs ...Expr)
func (*AssignStmt) Lhs ¶
func (a *AssignStmt) Lhs() []Expr
func (*AssignStmt) Rhs ¶
func (a *AssignStmt) Rhs() []Expr
func (*AssignStmt) SetLhs ¶
func (a *AssignStmt) SetLhs(lhs []Expr)
func (*AssignStmt) SetRhs ¶
func (a *AssignStmt) SetRhs(rhs []Expr)
type BaseType ¶
type BaseType struct {
// contains filtered or unexported fields
}
func NewBaseType ¶
func (*BaseType) AsResolvedType ¶
func (b *BaseType) AsResolvedType() *ResolvedType
func (*BaseType) Name ¶
func (b *BaseType) Name() Identifier
func (*BaseType) SetName ¶
func (b *BaseType) SetName(name Identifier)
func (*BaseType) SetTypeParams ¶
func (b *BaseType) SetTypeParams(typeParams []*ResolvedType)
type BinaryExpr ¶
type BinaryExpr struct {
// contains filtered or unexported fields
}
func NewBinaryExpr ¶
func NewBinaryExpr(with func(bnExpr *BinaryExpr)) *BinaryExpr
func (*BinaryExpr) Left ¶
func (b *BinaryExpr) Left() Expr
func (*BinaryExpr) Operator ¶
func (b *BinaryExpr) Operator() BinaryExprOp
func (*BinaryExpr) Right ¶
func (b *BinaryExpr) Right() Expr
func (*BinaryExpr) SetLeft ¶
func (b *BinaryExpr) SetLeft(left Expr)
func (*BinaryExpr) SetOperator ¶
func (b *BinaryExpr) SetOperator(operator BinaryExprOp)
func (*BinaryExpr) SetRight ¶
func (b *BinaryExpr) SetRight(right Expr)
type BlockStmt ¶
type BlockStmt struct {
// contains filtered or unexported fields
}
func NewBlockStmt ¶
type BoundedContextAnnotation ¶
type BoundedContextAnnotation struct {
// contains filtered or unexported fields
}
func NewBoundedContextAnnotation ¶
func NewBoundedContextAnnotation(alias string, pkg *Package, pos Pos) *BoundedContextAnnotation
func (*BoundedContextAnnotation) Alias ¶
func (s *BoundedContextAnnotation) Alias() string
func (*BoundedContextAnnotation) Name ¶
func (s *BoundedContextAnnotation) Name() string
func (*BoundedContextAnnotation) Pkg ¶
func (s *BoundedContextAnnotation) Pkg() *Package
func (*BoundedContextAnnotation) Pos ¶
func (s *BoundedContextAnnotation) Pos() Pos
func (*BoundedContextAnnotation) SetAlias ¶
func (s *BoundedContextAnnotation) SetAlias(alias string)
func (*BoundedContextAnnotation) SetPkg ¶
func (s *BoundedContextAnnotation) SetPkg(pkg *Package)
func (*BoundedContextAnnotation) SetPos ¶
func (s *BoundedContextAnnotation) SetPos(pos Pos)
type CallExpr ¶
type CallExpr struct {
// contains filtered or unexported fields
}
func NewCallExpr ¶
type Comment ¶
type Comment struct {
// contains filtered or unexported fields
}
func NewComment ¶
func NewSimpleComment ¶
func (*Comment) AddLines ¶
func (c *Comment) AddLines(lines ...*CommentLine)
func (*Comment) AddMacros ¶
func (c *Comment) AddMacros(macros ...*MacroInvocation)
func (*Comment) Lines ¶
func (c *Comment) Lines() []*CommentLine
func (*Comment) Macros ¶
func (c *Comment) Macros() []*MacroInvocation
func (*Comment) SetLines ¶
func (c *Comment) SetLines(lines []*CommentLine)
func (*Comment) SetMacros ¶
func (c *Comment) SetMacros(macros []*MacroInvocation)
type CommentLine ¶
type CommentLine struct {
// contains filtered or unexported fields
}
func NewCommentLine ¶
func NewCommentLine(with func(line *CommentLine)) *CommentLine
func (*CommentLine) Pos ¶
func (c *CommentLine) Pos() Pos
func (*CommentLine) SetPos ¶
func (c *CommentLine) SetPos(pos Pos)
func (*CommentLine) SetText ¶
func (c *CommentLine) SetText(text string)
func (*CommentLine) Text ¶
func (c *CommentLine) Text() string
type DistinctType ¶
type DistinctType struct {
// contains filtered or unexported fields
}
func NewDistinctType ¶
func NewDistinctType(with func(dType *DistinctType)) *DistinctType
func (*DistinctType) AsResolvedType ¶
func (d *DistinctType) AsResolvedType() *ResolvedType
func (*DistinctType) Clone ¶
func (d *DistinctType) Clone() TypeDef
func (*DistinctType) Comment ¶
func (d *DistinctType) Comment() *Comment
func (*DistinctType) Methods ¶
func (d *DistinctType) Methods() []*Func
func (*DistinctType) Name ¶
func (d *DistinctType) Name() Identifier
func (*DistinctType) Pkg ¶
func (d *DistinctType) Pkg() *Package
func (*DistinctType) SetComment ¶
func (d *DistinctType) SetComment(comment *Comment)
func (*DistinctType) SetMethods ¶
func (d *DistinctType) SetMethods(methods []*Func)
func (*DistinctType) SetName ¶
func (d *DistinctType) SetName(name Identifier)
func (*DistinctType) SetPkg ¶
func (d *DistinctType) SetPkg(pkg *Package)
func (*DistinctType) SetTypeParams ¶
func (d *DistinctType) SetTypeParams(typeParams []*ResolvedType)
func (*DistinctType) SetTypes ¶
func (d *DistinctType) SetTypes(types []*ResolvedType)
func (*DistinctType) SetUnderlying ¶
func (d *DistinctType) SetUnderlying(underlying TypeDef)
func (*DistinctType) SetVisibility ¶
func (d *DistinctType) SetVisibility(visibility Visibility)
func (*DistinctType) TypeParams ¶
func (d *DistinctType) TypeParams() []*ResolvedType
func (*DistinctType) Types ¶
func (d *DistinctType) Types() []*ResolvedType
func (*DistinctType) Underlying ¶
func (d *DistinctType) Underlying() TypeDef
func (*DistinctType) Visibility ¶
func (d *DistinctType) Visibility() Visibility
type DomainEventAnnotation ¶
type DomainEventAnnotation struct {
// contains filtered or unexported fields
}
func NewDomainEventAnnotation ¶
func NewDomainEventAnnotation(alias string, pos Pos, def TypeDef) *DomainEventAnnotation
func (*DomainEventAnnotation) Alias ¶
func (s *DomainEventAnnotation) Alias() string
func (*DomainEventAnnotation) Name ¶
func (s *DomainEventAnnotation) Name() string
func (*DomainEventAnnotation) Pos ¶
func (s *DomainEventAnnotation) Pos() Pos
func (*DomainEventAnnotation) SetAlias ¶
func (s *DomainEventAnnotation) SetAlias(alias string)
func (*DomainEventAnnotation) SetPos ¶
func (s *DomainEventAnnotation) SetPos(pos Pos)
func (*DomainEventAnnotation) SetTypeDef ¶
func (s *DomainEventAnnotation) SetTypeDef(typeDef TypeDef)
func (*DomainEventAnnotation) TypeDef ¶
func (s *DomainEventAnnotation) TypeDef() TypeDef
type DomainServiceAnnotation ¶
type DomainServiceAnnotation struct {
// contains filtered or unexported fields
}
func NewDomainServiceAnnotation ¶
func NewDomainServiceAnnotation(alias string, pos Pos, def TypeDef) *DomainServiceAnnotation
func (*DomainServiceAnnotation) Alias ¶
func (s *DomainServiceAnnotation) Alias() string
func (*DomainServiceAnnotation) Name ¶
func (s *DomainServiceAnnotation) Name() string
func (*DomainServiceAnnotation) Pos ¶
func (s *DomainServiceAnnotation) Pos() Pos
func (*DomainServiceAnnotation) SetAlias ¶
func (s *DomainServiceAnnotation) SetAlias(alias string)
func (*DomainServiceAnnotation) SetPos ¶
func (s *DomainServiceAnnotation) SetPos(pos Pos)
func (*DomainServiceAnnotation) SetTypeDef ¶
func (s *DomainServiceAnnotation) SetTypeDef(typeDef TypeDef)
func (*DomainServiceAnnotation) TypeDef ¶
func (s *DomainServiceAnnotation) TypeDef() TypeDef
type EntityAnnotation ¶
type EntityAnnotation struct {
// contains filtered or unexported fields
}
func NewEntityAnnotation ¶
func NewEntityAnnotation(alias string, pos Pos, def TypeDef) *EntityAnnotation
func (*EntityAnnotation) Alias ¶
func (s *EntityAnnotation) Alias() string
func (*EntityAnnotation) Name ¶
func (s *EntityAnnotation) Name() string
func (*EntityAnnotation) Pos ¶
func (s *EntityAnnotation) Pos() Pos
func (*EntityAnnotation) SetAlias ¶
func (s *EntityAnnotation) SetAlias(alias string)
func (*EntityAnnotation) SetPos ¶
func (s *EntityAnnotation) SetPos(pos Pos)
func (*EntityAnnotation) SetTypeDef ¶
func (s *EntityAnnotation) SetTypeDef(typeDef TypeDef)
func (*EntityAnnotation) TypeDef ¶
func (s *EntityAnnotation) TypeDef() TypeDef
type ErrorWithPos ¶
func NewErrorWithPos ¶
func NewErrorWithPos(pos Pos, cause error) *ErrorWithPos
func (ErrorWithPos) Error ¶
func (e ErrorWithPos) Error() string
func (ErrorWithPos) Unwrap ¶
func (e ErrorWithPos) Unwrap() error
type Field ¶
type Field struct {
// contains filtered or unexported fields
}
func (*Field) Name ¶
func (f *Field) Name() Identifier
func (*Field) SetComment ¶
func (*Field) SetName ¶
func (f *Field) SetName(name Identifier)
func (*Field) SetTypeDef ¶
func (f *Field) SetTypeDef(typeDef *ResolvedType)
func (*Field) SetVisibility ¶
func (f *Field) SetVisibility(visibility Visibility)
func (*Field) TypeDef ¶
func (f *Field) TypeDef() *ResolvedType
func (*Field) Visibility ¶
func (f *Field) Visibility() Visibility
type File ¶
type File struct {
// contains filtered or unexported fields
}
File represents a physical source code file respective compilation unit.
- Go: <lowercase AnnotationName>.go
- Java: <CamelCasePrimaryTypeName>.java
func (*File) AbsolutePath ¶
func (*File) AddImport ¶
func (f *File) AddImport(identifier Identifier, qualifier PkgImportQualifier)
func (*File) AddTypeDefs ¶
func (*File) Imports ¶
func (f *File) Imports() map[Identifier]PkgImportQualifier
func (*File) SetComment ¶
func (*File) SetGenerated ¶
func (*File) SetMimeType ¶
func (*File) SetModified ¶
func (*File) SetPreamble ¶
func (*File) SetRawBytes ¶
func (*File) SetTypeDefs ¶
type Func ¶
type Func struct {
// contains filtered or unexported fields
}
func (*Func) AddResults ¶
func (*Func) AddTypeParams ¶
func (f *Func) AddTypeParams(typeParams ...*ResolvedType)
func (*Func) AsResolvedType ¶
func (f *Func) AsResolvedType() *ResolvedType
func (*Func) Name ¶
func (f *Func) Name() Identifier
func (*Func) SetComment ¶
func (*Func) SetName ¶
func (f *Func) SetName(name Identifier)
func (*Func) SetReceiver ¶
func (*Func) SetResults ¶
func (*Func) SetTypeParams ¶
func (f *Func) SetTypeParams(typeParams []*ResolvedType)
func (*Func) SetVisibility ¶
func (f *Func) SetVisibility(visibility Visibility)
func (*Func) TypeParams ¶
func (f *Func) TypeParams() []*ResolvedType
func (*Func) Visibility ¶
func (f *Func) Visibility() Visibility
type Identifier ¶
type Identifier string
Identifier follows the typical identifier rules of Go or Java. Examples:
- Go: string, PkgName, Error, String, int64
- Java: List, String, Integer, int, toString
func (Identifier) String ¶
func (id Identifier) String() string
type Interface ¶
type Interface struct {
// contains filtered or unexported fields
}
func NewInterface ¶
func (*Interface) AddTypes ¶
func (u *Interface) AddTypes(types ...*ResolvedType)
func (*Interface) AsResolvedType ¶
func (u *Interface) AsResolvedType() *ResolvedType
func (*Interface) Name ¶
func (u *Interface) Name() Identifier
func (*Interface) SetComment ¶
func (*Interface) SetMethods ¶
func (*Interface) SetName ¶
func (u *Interface) SetName(name Identifier)
func (*Interface) SetTypeParams ¶
func (u *Interface) SetTypeParams(typeParams []*ResolvedType)
func (*Interface) SetTypes ¶
func (u *Interface) SetTypes(types []*ResolvedType)
func (*Interface) SetVisibility ¶
func (u *Interface) SetVisibility(visibility Visibility)
func (*Interface) Types ¶
func (u *Interface) Types() []*ResolvedType
func (*Interface) Visibility ¶
func (u *Interface) Visibility() Visibility
type MacroInvocation ¶
type MacroInvocation struct {
// contains filtered or unexported fields
}
MacroInvocation is parsed from texts in the following formats (see also MacroRegex]):
- #[<identifier>.<identifier> <json object body>?]
- for example #[go.TaggedUnion]
- for example #[go.TaggedUnion "tag":"$_type"]
func ParseMacroInvocation ¶
func ParseMacroInvocation(text string, pos Pos) (*MacroInvocation, error)
func (*MacroInvocation) DebugParsedParams ¶
func (m *MacroInvocation) DebugParsedParams() map[string]any
func (*MacroInvocation) JsonParams ¶
func (m *MacroInvocation) JsonParams() string
func (*MacroInvocation) Name ¶
func (m *MacroInvocation) Name() MacroName
func (*MacroInvocation) Pos ¶
func (m *MacroInvocation) Pos() Pos
func (*MacroInvocation) UnmarshalParams ¶
func (m *MacroInvocation) UnmarshalParams(dst any) error
func (*MacroInvocation) Value ¶
func (m *MacroInvocation) Value() string
Value returns some duck typing string from the json which looks like a value.
type MangeledName ¶
type MangeledName string
type MutPtr ¶
type MutPtr struct {
// contains filtered or unexported fields
}
func (*MutPtr) AsResolvedType ¶
func (m *MutPtr) AsResolvedType() *ResolvedType
func (*MutPtr) Comment ¶
func (m *MutPtr) Comment() []*CommentLine
func (*MutPtr) Macros ¶
func (m *MutPtr) Macros() []*MacroInvocation
func (*MutPtr) Name ¶
func (m *MutPtr) Name() Identifier
func (*MutPtr) SetComment ¶
func (m *MutPtr) SetComment(comment []*CommentLine)
func (*MutPtr) SetMacros ¶
func (m *MutPtr) SetMacros(macros []*MacroInvocation)
func (*MutPtr) SetTypeDef ¶
type Package ¶
type Package struct {
// contains filtered or unexported fields
}
func NewPackage ¶
func (*Package) AddTypeDefs ¶
func (*Package) AsResolvedType ¶
func (p *Package) AsResolvedType() *ResolvedType
func (*Package) Macros ¶
func (p *Package) Macros() []*MacroInvocation
func (*Package) Name ¶
func (p *Package) Name() Identifier
func (*Package) Qualifier ¶
func (p *Package) Qualifier() PkgImportQualifier
func (*Package) SetComment ¶
func (*Package) SetName ¶
func (p *Package) SetName(name Identifier)
func (*Package) SetQualifier ¶
func (p *Package) SetQualifier(qualifier PkgImportQualifier)
func (*Package) SetTypeComments ¶
func (p *Package) SetTypeComments(typeComments map[MangeledName]*Comment)
func (*Package) SetTypeDefs ¶
func (*Package) SetTypeParams ¶
func (p *Package) SetTypeParams(typeParams []*ResolvedType)
func (*Package) TypeComments ¶
func (p *Package) TypeComments() map[MangeledName]*Comment
type Param ¶
type Param struct {
// contains filtered or unexported fields
}
func (*Param) Name ¶
func (p *Param) Name() Identifier
func (*Param) SetName ¶
func (p *Param) SetName(name Identifier)
func (*Param) SetTypeDef ¶
func (p *Param) SetTypeDef(typeDef *ResolvedType)
func (*Param) TypeDef ¶
func (p *Param) TypeDef() *ResolvedType
type PermissionAnnotation ¶
type PermissionAnnotation struct {
// contains filtered or unexported fields
}
func NewPermissionAnnotation ¶
func NewPermissionAnnotation(with func(annotation *PermissionAnnotation)) *PermissionAnnotation
func (*PermissionAnnotation) PermissionID ¶
func (p *PermissionAnnotation) PermissionID() string
func (*PermissionAnnotation) Pos ¶
func (p *PermissionAnnotation) Pos() Pos
func (*PermissionAnnotation) SetPermissionID ¶
func (p *PermissionAnnotation) SetPermissionID(permissionID string)
func (*PermissionAnnotation) SetPos ¶
func (p *PermissionAnnotation) SetPos(pos Pos)
func (*PermissionAnnotation) SetTypeDef ¶
func (p *PermissionAnnotation) SetTypeDef(typeDef TypeDef)
func (*PermissionAnnotation) TypeDef ¶
func (p *PermissionAnnotation) TypeDef() TypeDef
type PkgImportQualifier ¶
type PkgImportQualifier string
A PkgImportQualifier denotes the unique and distinct qualifier for a package. Examples:
- Go: encoding/json (a path)
- Java: java.util
- TypeScript: @/shared/protocol/gen/event (a path)
- Rust: std::io
type PkgName ¶
type PkgName Identifier
A PkgName is the identifier of a package. Examples:
- Go: http, ast2, math (this has nothing to do with last segment of the import path)
- Java: util, collections (always the last segment)
- TypeScript: there is no package system. Identifiers are imported directly from file imports (just the relative path without file extension).
- Rust: std, io (looks like there are multiple ways to define them, some conventional by path, some explicit)
type Program ¶
type Program struct {
// contains filtered or unexported fields
}
func NewProgram ¶
func (*Program) AddAnnotations ¶
func (p *Program) AddAnnotations(annotations ...Annotation)
func (*Program) AddPackage ¶
func (*Program) Annotations ¶
func (p *Program) Annotations() []Annotation
func (*Program) MustResolveSimple ¶
func (p *Program) MustResolveSimple(path, ident string) *ResolvedType
func (*Program) PackageByPath ¶
func (p *Program) PackageByPath(q PkgImportQualifier) (*Package, bool)
func (*Program) SetAnnotations ¶
func (p *Program) SetAnnotations(annotations []Annotation)
type ProjectAnnotation ¶
type ProjectAnnotation struct {
// contains filtered or unexported fields
}
func NewProjectAnnotation ¶
func NewProjectAnnotation(alias string, pkg *Package, pos Pos) *ProjectAnnotation
func (*ProjectAnnotation) Alias ¶
func (s *ProjectAnnotation) Alias() string
func (*ProjectAnnotation) Name ¶
func (s *ProjectAnnotation) Name() string
func (*ProjectAnnotation) Pkg ¶
func (s *ProjectAnnotation) Pkg() *Package
func (*ProjectAnnotation) Pos ¶
func (s *ProjectAnnotation) Pos() Pos
func (*ProjectAnnotation) SetAlias ¶
func (s *ProjectAnnotation) SetAlias(alias string)
func (*ProjectAnnotation) SetPkg ¶
func (s *ProjectAnnotation) SetPkg(pkg *Package)
func (*ProjectAnnotation) SetPos ¶
func (s *ProjectAnnotation) SetPos(pos Pos)
type RepositoryAnnotation ¶
type RepositoryAnnotation struct {
// contains filtered or unexported fields
}
func NewRepositoryAnnotation ¶
func NewRepositoryAnnotation(alias string, pos Pos, def TypeDef) *RepositoryAnnotation
func (*RepositoryAnnotation) Alias ¶
func (s *RepositoryAnnotation) Alias() string
func (*RepositoryAnnotation) Name ¶
func (s *RepositoryAnnotation) Name() string
func (*RepositoryAnnotation) SetAlias ¶
func (s *RepositoryAnnotation) SetAlias(alias string)
func (*RepositoryAnnotation) SetTypeDef ¶
func (s *RepositoryAnnotation) SetTypeDef(typeDef TypeDef)
func (*RepositoryAnnotation) TypeDef ¶
func (s *RepositoryAnnotation) TypeDef() TypeDef
type ResolvedType ¶
type ResolvedType struct {
// contains filtered or unexported fields
}
ResolvedType tries to simplify things.
func NewResolvedType ¶
func NewResolvedType(with func(rType *ResolvedType)) *ResolvedType
func (*ResolvedType) AddParams ¶
func (r *ResolvedType) AddParams(params ...*ResolvedType)
func (*ResolvedType) AsTypeRef ¶
func (r *ResolvedType) AsTypeRef() *TypeRef
func (*ResolvedType) Name ¶
func (r *ResolvedType) Name() Identifier
func (*ResolvedType) Params ¶
func (r *ResolvedType) Params() []*ResolvedType
func (*ResolvedType) Pkg ¶
func (r *ResolvedType) Pkg() *Package
func (*ResolvedType) Pointer ¶
func (r *ResolvedType) Pointer() bool
func (*ResolvedType) SetName ¶
func (r *ResolvedType) SetName(name Identifier)
func (*ResolvedType) SetParams ¶
func (r *ResolvedType) SetParams(params []*ResolvedType)
func (*ResolvedType) SetPkg ¶
func (r *ResolvedType) SetPkg(pkg *Package)
func (*ResolvedType) SetPointer ¶
func (r *ResolvedType) SetPointer(pointer bool)
func (*ResolvedType) SetTypeDef ¶
func (r *ResolvedType) SetTypeDef(typeDef TypeDef)
func (*ResolvedType) SetTypeParam ¶
func (r *ResolvedType) SetTypeParam(typeParam bool)
func (*ResolvedType) TypeDef ¶
func (r *ResolvedType) TypeDef() TypeDef
func (*ResolvedType) TypeParam ¶
func (r *ResolvedType) TypeParam() bool
type ReturnStmt ¶
type ReturnStmt struct {
// contains filtered or unexported fields
}
func NewReturnStmt ¶
func NewReturnStmt(with func(*ReturnStmt)) *ReturnStmt
func (*ReturnStmt) AddResults ¶
func (r *ReturnStmt) AddResults(results ...Expr)
func (*ReturnStmt) Results ¶
func (r *ReturnStmt) Results() []Expr
func (*ReturnStmt) SetResults ¶
func (r *ReturnStmt) SetResults(results []Expr)
type SelectorExpr ¶
type SelectorExpr struct {
// contains filtered or unexported fields
}
func NewSelectorExpr ¶
func NewSelectorExpr(with func(sel *SelectorExpr)) *SelectorExpr
func (*SelectorExpr) Sel ¶
func (s *SelectorExpr) Sel() Identifier
func (*SelectorExpr) SetSel ¶
func (s *SelectorExpr) SetSel(sel Identifier)
func (*SelectorExpr) SetX ¶
func (s *SelectorExpr) SetX(x Expr)
func (*SelectorExpr) X ¶
func (s *SelectorExpr) X() Expr
type Struct ¶
type Struct struct {
// contains filtered or unexported fields
}
func (*Struct) AddMethods ¶
func (*Struct) AddTypeParams ¶
func (s *Struct) AddTypeParams(typeParams ...*ResolvedType)
func (*Struct) AsResolvedType ¶
func (s *Struct) AsResolvedType() *ResolvedType
func (*Struct) Name ¶
func (s *Struct) Name() Identifier
func (*Struct) SetComment ¶
func (*Struct) SetMethods ¶
func (*Struct) SetName ¶
func (s *Struct) SetName(name Identifier)
func (*Struct) SetTypeParams ¶
func (s *Struct) SetTypeParams(typeParams []*ResolvedType)
func (*Struct) SetTypes ¶
func (s *Struct) SetTypes(types []*ResolvedType)
func (*Struct) SetVisibility ¶
func (s *Struct) SetVisibility(visibility Visibility)
func (*Struct) TypeParams ¶
func (s *Struct) TypeParams() []*ResolvedType
func (*Struct) Types ¶
func (s *Struct) Types() []*ResolvedType
func (*Struct) Visibility ¶
func (s *Struct) Visibility() Visibility
type TypeDef ¶
type TypeDef interface { Name() Identifier AsResolvedType() *ResolvedType Comment() *Comment Clone() TypeDef SetTypeParams(typeParams []*ResolvedType) Pkg() *Package // contains filtered or unexported methods }
A TypeDef is a marker interface and contains all types which define the memory layout of a type. Note, that this is the c semantic and not the Go Spec semantic, which uses the term declaration for functions and other GenDecl like alias, interface et al. They use the term type definition when introducing a new defined type based on another type (e.g. type Text string)
type TypeParam ¶
type TypeParam struct {
// contains filtered or unexported fields
}
func NewTypeParam ¶
func (*TypeParam) AsResolvedType ¶
func (t *TypeParam) AsResolvedType() *ResolvedType
func (*TypeParam) Name ¶
func (t *TypeParam) Name() Identifier
func (*TypeParam) SetName ¶
func (t *TypeParam) SetName(name Identifier)
func (*TypeParam) SetTypeParams ¶
func (t *TypeParam) SetTypeParams(typeParams []*ResolvedType)
type TypeRef ¶
type TypeRef struct { Qualifier PkgImportQualifier Name Identifier Pointer bool Params []*TypeRef TypeParam bool // TODO how to model bound (go) and upper and lower bounds (java) Receiver *TypeRef // a TypeRef may also reference a function or method, so we need to distinguish those collisions }
type Union ¶
type Union struct {
// contains filtered or unexported fields
}
func (*Union) AddTypes ¶
func (u *Union) AddTypes(types ...*ResolvedType)
func (*Union) AsResolvedType ¶
func (u *Union) AsResolvedType() *ResolvedType
func (*Union) Name ¶
func (u *Union) Name() Identifier
func (*Union) SetComment ¶
func (*Union) SetName ¶
func (u *Union) SetName(name Identifier)
func (*Union) SetTypeParams ¶
func (u *Union) SetTypeParams(typeParams []*ResolvedType)
func (*Union) SetTypes ¶
func (u *Union) SetTypes(types []*ResolvedType)
func (*Union) SetVisibility ¶
func (u *Union) SetVisibility(visibility Visibility)
func (*Union) Types ¶
func (u *Union) Types() []*ResolvedType
func (*Union) Visibility ¶
func (u *Union) Visibility() Visibility
type UseCaseAnnotation ¶
type UseCaseAnnotation struct {
// contains filtered or unexported fields
}
func NewUseCaseAnnotation ¶
func NewUseCaseAnnotation(alias string, fn *Func, pos Pos) *UseCaseAnnotation
func (*UseCaseAnnotation) Alias ¶
func (s *UseCaseAnnotation) Alias() string
func (*UseCaseAnnotation) Fn ¶
func (s *UseCaseAnnotation) Fn() *Func
func (*UseCaseAnnotation) Name ¶
func (s *UseCaseAnnotation) Name() string
func (*UseCaseAnnotation) Pos ¶
func (s *UseCaseAnnotation) Pos() Pos
func (*UseCaseAnnotation) SetAlias ¶
func (s *UseCaseAnnotation) SetAlias(alias string)
func (*UseCaseAnnotation) SetFn ¶
func (s *UseCaseAnnotation) SetFn(fn *Func)
func (*UseCaseAnnotation) SetPos ¶
func (s *UseCaseAnnotation) SetPos(pos Pos)
func (*UseCaseAnnotation) TypeDef ¶
func (s *UseCaseAnnotation) TypeDef() TypeDef
type ValueAnnotation ¶
type ValueAnnotation struct {
// contains filtered or unexported fields
}
func NewValueAnnotation ¶
func NewValueAnnotation(alias string, pos Pos, def TypeDef) *ValueAnnotation
func (*ValueAnnotation) Alias ¶
func (s *ValueAnnotation) Alias() string
func (*ValueAnnotation) Name ¶
func (s *ValueAnnotation) Name() string
func (*ValueAnnotation) Pos ¶
func (s *ValueAnnotation) Pos() Pos
func (*ValueAnnotation) SetAlias ¶
func (s *ValueAnnotation) SetAlias(alias string)
func (*ValueAnnotation) SetPos ¶
func (s *ValueAnnotation) SetPos(pos Pos)
func (*ValueAnnotation) SetTypeDef ¶
func (s *ValueAnnotation) SetTypeDef(typeDef TypeDef)
func (*ValueAnnotation) TypeDef ¶
func (s *ValueAnnotation) TypeDef() TypeDef