introspector

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FieldInfo

type FieldInfo struct {
	Name        string
	Type        string
	JSONTag     string
	Required    bool
	Description string
}

type Introspector

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

Introspector analyzes Go source code to generate manifests.

func NewIntrospector

func NewIntrospector(projectRoot string) *Introspector

NewIntrospector creates a new introspector.

func (*Introspector) GenerateManifest

func (i *Introspector) GenerateManifest(pluginID string) (*manifest.Manifest, error)

GenerateManifest creates a manifest from introspection data.

func (*Introspector) IntrospectHandlers

func (i *Introspector) IntrospectHandlers(handlerPath string) (*RouteInfo, error)

IntrospectHandlers analyzes handler files to extract route information.

func (*Introspector) IntrospectPlugin

func (i *Introspector) IntrospectPlugin(pluginPath string) (*PluginInfo, error)

IntrospectPlugin analyzes a plugin directory.

func (*Introspector) IntrospectRoutes

func (i *Introspector) IntrospectRoutes(routesPath string) ([]RouteRegistration, error)

IntrospectRoutes analyzes route registration to extract HTTP methods and paths.

type PluginInfo

type PluginInfo struct {
	ID          string
	Name        string
	Version     string
	Description string
}

type Route

type Route struct {
	Name         string
	Description  string
	RequestType  string
	ResponseType string
}

type RouteInfo

type RouteInfo struct {
	Handler string
	Routes  []Route
	Types   map[string]*TypeInfo
}

type RouteRegistration

type RouteRegistration struct {
	Method       string
	Path         string
	HandlerName  string
	RequestType  string // Type name from WithRequestSchema
	ResponseType string // Type name from WithResponseSchema
}

type RouterGroup added in v0.0.15

type RouterGroup struct {
	VarName   string // Variable name (e.g., "grp", "deviceGroup")
	Path      string // Group path (e.g., "/oauth2", "/device")
	ParentVar string // Parent variable name (e.g., "router", "grp")
	FullPath  string // Full accumulated path (e.g., "/oauth2", "/oauth2/device")
}

RouterGroup represents a router group declaration for path prefix tracking.

type TypeInfo

type TypeInfo struct {
	Name        string
	Description string
	Fields      map[string]FieldInfo
}

Jump to

Keyboard shortcuts

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