Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFieldValue ¶
func ParseLineFields ¶
func ParseOperationFromAnnotations ¶
func ParseOperationFromAnnotations(id string, ans Annotations) (*spec.Operation, error)
parseOperationFromAnnotations 通过解析 Annotations 构造 spec.Operation。 大部分格式参考了 swaggo 的注解(https://pkg.go.dev/github.com/swaggo/swag@v1.16.1#readme-api-operation),去掉了一些不好实现的部分。
Types ¶
type Annotation ¶
type Annotation struct {
// contains filtered or unexported fields
}
func (*Annotation) Line ¶
func (a *Annotation) Line(i int) string
func (*Annotation) LineNum ¶
func (a *Annotation) LineNum() int
func (*Annotation) Text ¶
func (a *Annotation) Text() string
type Annotations ¶
type Annotations []*Annotation
func ExtractAnnotations ¶
func ExtractAnnotations(comments string) Annotations
func (Annotations) Get ¶
func (ans Annotations) Get(name string) *Annotation
Click to show internal directories.
Click to hide internal directories.