annotations

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFieldValue

func GetFieldValue(fields []string, i int) string

func ParseLineFields

func ParseLineFields(line string, sep byte) []string

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL