scan

package
v0.0.0-...-f172b53 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogLevel

type LogLevel int
const (
	LogLevelDebug LogLevel = iota
	LogLevelInfo
	LogLevelWarn
	LogLevelError
	LogLevelFatal
)

type Logger

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

func NewLogger

func NewLogger(level LogLevel) *Logger

func (*Logger) Debug

func (logger *Logger) Debug(message string, keys ...interface{})

func (*Logger) Error

func (logger *Logger) Error(message string, keys ...interface{})

func (*Logger) Fatal

func (logger *Logger) Fatal(message string, keys ...interface{})

func (*Logger) Info

func (logger *Logger) Info(message string, keys ...interface{})

func (*Logger) SetLogLevel

func (logger *Logger) SetLogLevel(level LogLevel)

func (*Logger) Warn

func (logger *Logger) Warn(message string, keys ...interface{})

type Parameter

type Parameter struct {
	Name        string
	In          string
	Description string
	Type        string
	Required    string
}

type Parser

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

Parser is a struct that holds the state of the parser.

func NewParser

func NewParser(logger *Logger) *Parser

NewParser creates a new instance of the Parser struct.

func (*Parser) GetSpec

func (p *Parser) GetSpec(dirs []string) (*openapi3.T, error)

func (*Parser) GetTypeSpec

func (p *Parser) GetTypeSpec(t ast.Expr) *ast.TypeSpec

func (*Parser) ParseTypeExpr

func (p *Parser) ParseTypeExpr(key string, expr ast.Expr) *openapi3.SchemaRef

ParseTypeExpr returns the OpenAPI schema for the given Go type expression. Returns nil if the expression is not a valid type. TODO: should search cache based on openapi:name tag instead of field name

func (*Parser) ProcessFile

func (p *Parser) ProcessFile(path string, file *ast.File) error

func (*Parser) WithMetaPath

func (p *Parser) WithMetaPath(path string) *Parser

type RequestBody

type RequestBody struct {
	Name        string
	Description string
}

type ResponseBody

type ResponseBody struct {
	Name        string
	Code        string
	Description string
}

Jump to

Keyboard shortcuts

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