dumper

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Carrier added in v0.1.11

func Carrier(t ImportTracker) contextx.Carrier

func CarrierEntry added in v0.1.11

func CarrierEntry(entry string) contextx.Carrier

func IsStd

func IsStd(path string) bool

func Load added in v0.1.2

func Load(ctx context.Context, path string) (pkg *gopkg.Package)

func With added in v0.1.11

func WithEntry added in v0.1.11

func WithEntry(ctx context.Context, entry string) context.Context

Types

type Import

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

func NewImport added in v0.1.2

func NewImport(ctx context.Context, path string) *Import

func (*Import) Alias

func (i *Import) Alias() string

func (*Import) Code

func (i *Import) Code() string

func (*Import) MakeAlias added in v0.1.2

func (i *Import) MakeAlias()

func (*Import) Name

func (i *Import) Name() string

func (*Import) Path

func (i *Import) Path() string

type ImportTracker

type ImportTracker interface {
	// Track adds package path and name
	Track(context.Context, string)
	// TrackCustom adds package tracking with custom alias
	TrackCustom(context.Context, string, string)
	// PackageName returns the ref leader of package path
	PackageName(string) string
	// Range traverse imports
	Range(func(Import) bool)
	// Init adjust imported package alias
	Init()
	// Entry returns tracker's entry package path
	Entry() string
	// Module return tracker's module path
	Module() string
}

func From added in v0.1.11

func From(ctx context.Context) ImportTracker

func MergeTrackers added in v0.1.11

func MergeTrackers(trackers ...ImportTracker) ImportTracker

func NewImportTracker

func NewImportTracker(entry string) ImportTracker

Jump to

Keyboard shortcuts

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