imports

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDepth = 256
)

Variables

View Source
var (
	// ErrPkg a common package error.
	ErrPkg = errors.New("imports")
	// ErrPkgLoad error.
	ErrPkgLoad = fmt.Errorf("%w: unable to load packages", ErrPkg)
)

Functions

This section is empty.

Types

type DefaultParser

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

func New

func New(options ...Option) *DefaultParser

New factory function.

func (*DefaultParser) Parse

func (p *DefaultParser) Parse(path string) (*Packages, error)

type Option

type Option func(p *DefaultParser)

Option function.

func WithDepth

func WithDepth(depth int) Option

WithDepth configuration option.

func WithExcludeInternal

func WithExcludeInternal(exclude bool) Option

WithExcludeInternal configuration option.

func WithExcludePaths

func WithExcludePaths(paths []string) Option

WithExcludePaths configuration option.

func WithExcludeStandard

func WithExcludeStandard(exclude bool) Option

WithExcludeStandard configuration option.

func WithExcludeVendor

func WithExcludeVendor(exclude bool) Option

WithExcludeVendor configuration option.

func WithOwned

func WithOwned(owned []string) Option

WithOwned configuration option.

func WithRootPath

func WithRootPath(rootPath string) Option

WithRootPath configuration option.

type Package

type Package struct {
	Name, Path, Label string
	// IsLocal indicates the package is part of the scanned project.
	IsLocal, IsOwned                             bool
	IsExternal, IsStandard, IsInternal, IsVendor bool
	DepPaths                                     []string
}

Package item structure.

type Packages

type Packages struct {
	Paths []string
	List  []*Package
}

Packages holding all information about the used packages.

Jump to

Keyboard shortcuts

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