Documentation
¶
Index ¶
- func Command(ctx context.Context, root, name string, args ...string) error
- func CommandOutput(ctx context.Context, root, name string, args ...string) ([]byte, error)
- func IsMissingTool(err error) bool
- func IsNotWirable(err error) bool
- func IsToolUnavailable(err error) bool
- func NotWirable(reason string) error
- func NotWirableReason(err error) string
- func RequireTool(ctx context.Context, ecosystem string, variant Variant) error
- func VersionAtLeast(versionText, minimum string) bool
- type Adapter
- type Change
- type Dependency
- type Export
- type Finding
- type Locked
- type MissingToolError
- type NotWirableError
- type ToolRequirement
- type ToolStatus
- type ToolVersionError
- type Variant
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandOutput ¶
func IsMissingTool ¶
func IsNotWirable ¶
func IsToolUnavailable ¶
func NotWirable ¶
func NotWirableReason ¶
func VersionAtLeast ¶
Types ¶
type Adapter ¶
type Adapter interface {
Ecosystem() string
Detect(root string) (bool, Variant, error)
// Capability is a read-only check that rejects only source shapes this
// concrete variant cannot represent. Tool and network checks are separate.
Capability(root string, dep Dependency, exp Export) error
// Pull edits the native declaration and makes the dependency usable locally.
// It must also repair missing materialization when the declaration is current.
Pull(ctx context.Context, root string, dep Dependency, exp Export, locked Locked) (Change, error)
// Remove converges the native declaration, lock and project-local installed state.
Remove(ctx context.Context, root string, dep Dependency, exp Export, locked Locked) (Change, error)
// Inspect is local and read-only.
Inspect(ctx context.Context, root string, dep Dependency, exp Export, locked Locked) ([]Finding, error)
}
type Dependency ¶
type Dependency = manifest.Dependency
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
Click to show internal directories.
Click to hide internal directories.