Documentation ¶
Index ¶
- func AnnotationParamsTo[T any](val *T, a *Annotation) (t *T, err error)
- func FindCommentLocationCommentGroup(fileNode *ast.File, fileSet *token.FileSet, pos token.Pos) *ast.CommentGroup
- func FindDocLocationCommentGroup(fileNode *ast.File, fileSet *token.FileSet, pos token.Pos) *ast.CommentGroup
- func GetCommentText(comment *Comment) string
- func GetCommentsText(comments []*Comment) string
- func GetRecvType(fd *ast.FuncDecl) *ast.TypeSpec
- func InspectMapper[From any, To any](fileNode *ast.File, fileSet *token.FileSet, mapper func(*From) *To) []*To
- func ParseFile(inputFile string) (*ast.File, *token.FileSet, error)
- type Annotation
- type AnnotationExtend
- type AnnotationGroup
- type AnnotationParam
- type BaseGenerator
- func (bg *BaseGenerator[T]) ExecuteTemplate(wr io.Writer, name string) error
- func (bg *BaseGenerator[T]) GetImports() []string
- func (bg *BaseGenerator[T]) WriteBody(wr io.Writer) error
- func (bg *BaseGenerator[T]) WriteConst(wr io.Writer) error
- func (bg *BaseGenerator[T]) WriteInitFunc(wr io.Writer) error
- type Bool
- type Boolean
- type ClosedBracket
- type ClosedParenthesis
- type Comment
- type Extends
- type Float
- type Generator
- type Int
- type Key
- type Name
- type Params
- type String
- type Uint
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnotationParamsTo ¶
func AnnotationParamsTo[T any](val *T, a *Annotation) (t *T, err error)
func GetCommentText ¶
func GetCommentsText ¶
func InspectMapper ¶
Types ¶
type Annotation ¶
type AnnotationExtend ¶
type AnnotationGroup ¶
type AnnotationGroup struct {
Annotations []*Annotation `@@*`
}
func ParseAnnotation ¶
func ParseAnnotation(fileName string, text string) (*AnnotationGroup, error)
func (*AnnotationGroup) FindAnnotationByName ¶
func (ag *AnnotationGroup) FindAnnotationByName(name string) *Annotation
type AnnotationParam ¶
type BaseGenerator ¶
func (*BaseGenerator[T]) ExecuteTemplate ¶
func (bg *BaseGenerator[T]) ExecuteTemplate(wr io.Writer, name string) error
func (*BaseGenerator[T]) GetImports ¶
func (bg *BaseGenerator[T]) GetImports() []string
func (*BaseGenerator[T]) WriteConst ¶
func (bg *BaseGenerator[T]) WriteConst(wr io.Writer) error
func (*BaseGenerator[T]) WriteInitFunc ¶
func (bg *BaseGenerator[T]) WriteInitFunc(wr io.Writer) error
type ClosedBracket ¶
type ClosedParenthesis ¶
type Extends ¶
type Extends struct { List []*AnnotationExtend `"{" @@*` ClosedBracket ClosedBracket `@@` }
type Params ¶
type Params struct { List []*AnnotationParam `"(" @@*` ClosedParenthesis ClosedParenthesis `@@` }
Click to show internal directories.
Click to hide internal directories.