adapter

package
v1.3.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(ctx context.Context, root, name string, args ...string) error

func CommandOutput

func CommandOutput(ctx context.Context, root, name string, args ...string) ([]byte, error)

func IsMissingTool

func IsMissingTool(err error) bool

func IsNotWirable

func IsNotWirable(err error) bool

func IsToolUnavailable

func IsToolUnavailable(err error) bool

func NotWirable

func NotWirable(reason string) error

func NotWirableReason

func NotWirableReason(err error) string

func RequireTool

func RequireTool(ctx context.Context, ecosystem string, variant Variant) error

func VendorSourcePath added in v1.2.0

func VendorSourcePath(exp Export, locked Locked) string

VendorSourcePath returns the consumer-root-relative directory that contains an export. Copy vendors already materialise dependency.path as their root; submodules retain it.

func VersionAtLeast

func VersionAtLeast(versionText, minimum string) bool

Types

type Adapter

type Adapter interface {
	Ecosystem() string
	Detect(root string) (bool, Variant, error)
	Wire(ctx context.Context, root string, dep Dependency, exp Export, locked Locked) (Change, error)
	Unwire(ctx context.Context, root string, dep Dependency, exp Export) (Change, error)
	Refresh(ctx context.Context, root string, dep Dependency, exp Export, locked Locked) error
	Drift(ctx context.Context, root string, dep Dependency, exp Export, locked Locked) ([]Finding, error)
}

type Change

type Change struct {
	File, Entry, Warning string
	Changed              bool
}

type Dependency

type Dependency = manifest.Dependency

type Export

type Export = manifest.Export

type Finding

type Finding struct{ File, Entry, Want, Got string }

type Locked

type Locked = manifest.LockedDependency

type MissingToolError

type MissingToolError struct{ Requirement ToolRequirement }

func (MissingToolError) Error

func (e MissingToolError) Error() string

type NotWirableError

type NotWirableError struct{ Reason string }

func (NotWirableError) Error

func (e NotWirableError) Error() string

type ToolRequirement

type ToolRequirement struct {
	Ecosystem  string   `json:"ecosystem"`
	Command    string   `json:"command"`
	VersionArg []string `json:"versionArgs"`
	Minimum    string   `json:"minimum,omitempty"`
	Install    string   `json:"install"`
}

func GitTool

func GitTool() ToolRequirement

func ToolFor

func ToolFor(ecosystem string, variant Variant) ToolRequirement

type ToolStatus

type ToolStatus struct {
	ToolRequirement
	Found   bool   `json:"found"`
	Path    string `json:"path,omitempty"`
	Version string `json:"version,omitempty"`
	Ready   bool   `json:"ready"`
}

func InspectTool

func InspectTool(ctx context.Context, requirement ToolRequirement) ToolStatus

type ToolVersionError

type ToolVersionError struct {
	Requirement ToolRequirement
	Version     string
}

func (ToolVersionError) Error

func (e ToolVersionError) Error() string

type Variant

type Variant string

Jump to

Keyboard shortcuts

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