docparser

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindStruct added in v0.5.1

func FindStruct(pkgs []*packages.Package, tname string) (map[string]interface{}, error)

find a struct type by a name (used for looking up {models.ErrorResponse} in comments)

func ParseLine

func ParseLine(pkgs []*packages.Package, key, value string, data map[string]interface{}) error

Types

type Comments

type Comments struct {
	Raw      []string
	Tags     map[string]*structtag.Tags
	Comments []string
}

type DocData

type DocData struct {
	Doc      string
	Raw      []string
	Comments []string
	Data     map[string]interface{}
}

func GetDocComments

func GetDocComments(pkgs []*packages.Package, pos token.Position) (*DocData, error)

func ParseDoc

func ParseDoc(pkgs []*packages.Package, doc string) (*DocData, error)

func (*DocData) Parameter

func (d *DocData) Parameter(varName string) (map[string]interface{}, bool)

Jump to

Keyboard shortcuts

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