inspector

package
v0.0.0-...-aa42d66 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2025 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

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

Factory creates appropriate inspectors based on language

func NewFactory

func NewFactory(config *graph.Config) *Factory

NewFactory creates a new inspector factory with the given config

func (*Factory) GetInspector

func (f *Factory) GetInspector(filename string) (Inspector, error)

GetInspector returns an appropriate inspector based on file extension

func (*Factory) InspectFile

func (f *Factory) InspectFile(filename string) (*graph.File, error)

InspectFile is a convenience method that gets the appropriate inspector and inspects the file

func (*Factory) InspectPackage

func (f *Factory) InspectPackage(packagePath string) (*graph.Package, error)

InspectPackage is a convenience method that gets the appropriate inspector for a package

func (*Factory) InspectProject

func (f *Factory) InspectProject(project *repository.Project) (*graph.Project, error)

InspectProject is a convenience method that gets the appropriate inspector for a package

type Inspector

type Inspector interface {
	// InspectSource parses source code from a byte slice and extracts type information
	InspectSource(src []byte) (*graph.File, error)

	// InspectFile parses a source file and extracts type information
	InspectFile(filename string) (*graph.File, error)

	// InspectPackage inspects a package directory and extracts all type information
	InspectPackage(packagePath string) (*graph.Package, error)

	// InspectProject inspects a project directory and extracts all type information
	InspectProject(location string) (*graph.Project, error)
}

Inspector provides an interface for inspecting source code

Directories

Path Synopsis
example command

Jump to

Keyboard shortcuts

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