handler

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EstimateTotalTokens

func EstimateTotalTokens(files []string, ctxFile string) int

EstimateTotalTokens estimates the total number of tokens for all handlers in the given files.

func ProcessFiles

func ProcessFiles(files []string, client api.Client, dryRun bool, model string, contextFilePath string) error

ProcessFiles processes the given files to add Swagger comments to handler functions.

Types

type ContextFileHandler added in v0.0.3

type ContextFileHandler struct {
}

func (*ContextFileHandler) ExtractRoutes added in v0.0.3

func (ch *ContextFileHandler) ExtractRoutes(contextFilePath string) ([]model.Route, error)

type FileHandlerPair

type FileHandlerPair struct {
	FilePath string
	Handler  *ast.FuncDecl
}

FileHandlerPair is a struct that holds a file path and a handler function.

type HandlerResult

type HandlerResult struct {
	Handler  *ast.FuncDecl
	Comment  string
	Error    error
	StartPos int
	EndPos   int
}

HandlerResult holds the result of processing a single handler.

type RouteExtractor added in v0.0.3

type RouteExtractor struct {
	Routes []model.Route
	// contains filtered or unexported fields
}

func (*RouteExtractor) Visit added in v0.0.3

func (re *RouteExtractor) Visit(node ast.Node) ast.Visitor

Jump to

Keyboard shortcuts

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