dependency

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package dependency restores projects from a validated pawn.lock.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitInstaller

type GitInstaller struct {
	Command string
	// contains filtered or unexported fields
}

GitInstaller restores Git dependencies at their locked commits.

func (GitInstaller) Install

func (g GitInstaller) Install(
	ctx context.Context,
	pkg lockfile.Package,
	target string,
) (Status, error)

Install clones pkg into target without replacing an existing checkout.

type Installer

type Installer interface {
	Install(context.Context, lockfile.Package, string) (Status, error)
}

Installer installs a locked source at target.

type Restorer

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

Restorer installs the dependencies described by a lockfile.

func NewRestorer

func NewRestorer(fsys fsx.FS, installer Installer) *Restorer

NewRestorer creates a dependency restorer.

func (*Restorer) Restore

func (r *Restorer) Restore(ctx context.Context, root string, lock *lockfile.Lock) ([]Result, error)

Restore installs missing dependencies below root.

type Result

type Result struct {
	Name   string `json:"name"`
	Path   string `json:"path"`
	Status Status `json:"status"`
}

Result describes one restored dependency.

type Status

type Status string

Status describes a restored dependency.

const (
	StatusInstalled Status = "installed"
	StatusPresent   Status = "present"
	StatusLocal     Status = "local"
)

Jump to

Keyboard shortcuts

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