Documentation
¶
Overview ¶
Package codescan provides a scanner for go files that produces a swagger spec document.
This package is intended for go1.25 onwards and uses go1.26 toolchain.
It supports go modules.
Index ¶
Constants ¶
View Source
const (
// ErrCodeScan is the sentinel error for all errors originating from the codescan package.
ErrCodeScan codescanError = "codescan error"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
builders/common
Package common holds shared per-Builder state every concrete per-decl builder (schema, parameters, responses, routes, operations, spec) embeds.
|
Package common holds shared per-Builder state every concrete per-decl builder (schema, parameters, responses, routes, operations, spec) embeds. |
|
builders/handlers
Package handlers ships shared grammar Walker callbacks for the SimpleSchema and full-Schema families of OAS v2 dispatchers.
|
Package handlers ships shared grammar Walker callbacks for the SimpleSchema and full-Schema families of OAS v2 dispatchers. |
|
builders/validations
Package validations owns cross-builder validation and coercion concerns shared by the schema, parameters, responses, and items/headers code paths.
|
Package validations owns cross-builder validation and coercion concerns shared by the schema, parameters, responses, and items/headers code paths. |
|
ifaces
Package ifaces defines the internal interfaces that decouple the comment-parsing pipeline from the concrete Swagger spec builders.
|
Package ifaces defines the internal interfaces that decouple the comment-parsing pipeline from the concrete Swagger spec builders. |
|
integration
Package integration provides integration tests.
|
Package integration provides integration tests. |
|
parsers/grammar
Package grammar is the annotation parser for codescan.
|
Package grammar is the annotation parser for codescan. |
|
parsers/routebody
Package routebody parses the body sub-language of swagger:route / swagger:operation `Parameters:` and `Responses:` raw blocks.
|
Package routebody parses the body sub-language of swagger:route / swagger:operation `Parameters:` and `Responses:` raw blocks. |
|
parsers/security
Package security is a thin sub-parser for the `Security:` block body that appears under both `swagger:meta` and `swagger:route`.
|
Package security is a thin sub-parser for the `Security:` block body that appears under both `swagger:meta` and `swagger:route`. |
|
parsers/yaml
Package yaml is a thin wrapper around go.yaml.in/yaml/v3 for consuming the RawYAML bodies that internal/parsers/grammar/ isolates between `---` fences, plus the typed-extensions service the grammar lexer calls for `extensions:` raw blocks.
|
Package yaml is a thin wrapper around go.yaml.in/yaml/v3 for consuming the RawYAML bodies that internal/parsers/grammar/ isolates between `---` fences, plus the typed-extensions service the grammar lexer calls for `extensions:` raw blocks. |
|
scanner/classify
Package classify provides small classification predicates used by the scanner and by builders to decide whether a given name or comment line belongs to a particular Swagger-annotation family.
|
Package classify provides small classification predicates used by the scanner and by builders to decide whether a given name or comment line belongs to a particular Swagger-annotation family. |
|
scantest
Package scantest exposes utilities for testing the codescan packages.
|
Package scantest exposes utilities for testing the codescan packages. |
|
scantest/mocks
Package mocks contains mock types for all interfaces.
|
Package mocks contains mock types for all interfaces. |
Click to show internal directories.
Click to hide internal directories.