parser

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Doc       string
	Name      string
	Pkg       string
	Request   *request.Request
	Responses response.StatusCodeMapping
}

type Model

type Model struct {
	Name    string
	PkgPath string
}

type ParseOpt

type ParseOpt func(p *parserOpts)

func ParseAllModels

func ParseAllModels() ParseOpt

ParseAllModels will allow you to parse all models in package used by echo.Bind call and declared in package

func ParseEnums

func ParseEnums() ParseOpt

func ParseInlineForms

func ParseInlineForms() ParseOpt

func ParseInlinePathParams

func ParseInlinePathParams() ParseOpt

func ParseInlineQueryParams

func ParseInlineQueryParams() ParseOpt

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func New

func New() (*Parser, error)

func (*Parser) Parse

func (p *Parser) Parse(pkg *packages.Package, opts ...ParseOpt) (Result, error)

Parse parses package and returns all found enums and handlers

type Result

type Result struct {
	Enums    map[string][]any
	Handlers []Handler
	// AdditionalModels will contain array of all type declarations and structs used in c.Bind(), if ParseAllModels was provided as opt.
	//It can contain duplicates, it's up to you to deduplicate them. Zero objects (with empty Name and PkgPath not added)
	AdditionalModels []Model
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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