scanner

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EndpointDef

type EndpointDef struct {
	Method       string         `json:"method"`
	Path         string         `json:"path"`
	Summary      string         `json:"summary"`
	RequestBody  map[string]any `json:"requestBody,omitempty"`
	ResponseBody map[string]any `json:"responseBody,omitempty"`
}

EndpointDef represents a single scraped OpenAPI endpoint

type FileExtractResult

type FileExtractResult struct {
	File      string
	Endpoints []EndpointDef
	Error     error
}

FileExtractResult holds the endpoints found in one specific file

type IgnoreMatcher

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

IgnoreMatcher holds gitignore patterns and evaluates if a file should be ignored

func NewIgnoreMatcher

func NewIgnoreMatcher(dir string) (*IgnoreMatcher, error)

NewIgnoreMatcher creates a new matcher from a .gitignore file

func (*IgnoreMatcher) IsIgnored

func (m *IgnoreMatcher) IsIgnored(path string, isDir bool) bool

IsIgnored returns true if the given path matches any ignore patterns

type OasDocument

type OasDocument struct {
	OpenAPI string                 `yaml:"openapi"`
	Info    OasInfo                `yaml:"info"`
	Paths   map[string]OasPathItem `yaml:"paths"`
}

OasDocument represents a top-level OpenAPI 3.1 spec

type OasInfo

type OasInfo struct {
	Title       string `yaml:"title"`
	Description string `yaml:"description"`
	Version     string `yaml:"version"`
}

type OasMediaType

type OasMediaType struct {
	Schema map[string]any `yaml:"schema"`
}

type OasOperation

type OasOperation struct {
	Summary     string                 `yaml:"summary,omitempty"`
	RequestBody *OasRequestBody        `yaml:"requestBody,omitempty"`
	Responses   map[string]OasResponse `yaml:"responses"`
}

type OasPathItem

type OasPathItem map[string]OasOperation // "get", "post", etc. -> OasOperation

type OasRequestBody

type OasRequestBody struct {
	Content map[string]OasMediaType `yaml:"content"`
}

type OasResponse

type OasResponse struct {
	Description string                  `yaml:"description"`
	Content     map[string]OasMediaType `yaml:"content,omitempty"`
}

type ProjectFramework

type ProjectFramework struct {
	Language  string `json:"language"`
	Framework string `json:"framework"`
}

ProjectFramework contains LLM-detected metadata about the project

type RouterFile

type RouterFile struct {
	Path        string
	HitKeywords []string
}

RouterFile contains the path to a routing file and some metadata about it

type Scanner

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

Scanner orchestrates the codebase scan

func NewScanner

func NewScanner(provider common.Provider, dir, outFile string) (*Scanner, error)

NewScanner creates a new Scanner instance

func (*Scanner) RunScan

func (s *Scanner) RunScan(progressCallback func(string)) error

RunScan starts the OOPS Pipeline scanning process

Jump to

Keyboard shortcuts

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