pkgmgr

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, factory FactoryFunc)

Register registers a package manager factory function

Types

type FactoryFunc

type FactoryFunc func(customPath string) (PackageManager, error)

FactoryFunc is a function that creates a new package manager instance

type InitOptions

type InitOptions struct {
	EnvPath   string    // Path where environment will be created
	Name      string    // Environment name
	Python    string    // Python version (if applicable)
	Channels  []string  // Conda channels (pixi only)
	LogWriter io.Writer // Optional writer for streaming command output
}

InitOptions contains parameters for initializing a new environment

type InstallOptions

type InstallOptions struct {
	EnvPath   string    // Path to environment
	Packages  []string  // Package names (e.g., "numpy==1.24.0")
	LogWriter io.Writer // Optional writer for streaming command output
}

InstallOptions contains parameters for installing packages

type ListOptions

type ListOptions struct {
	EnvPath string // Path to environment
}

ListOptions contains parameters for listing packages

type Manifest

type Manifest struct {
	Name     string
	Packages map[string]string // name -> version
	Channels []string
	Raw      []byte // Raw manifest content
}

Manifest represents a package manager manifest file

type Package

type Package struct {
	Name    string
	Version string
	Channel string // For conda-based managers
}

Package represents an installed package

type PackageManager

type PackageManager interface {
	// Name returns the package manager name (e.g., "pixi", "uv")
	Name() string

	// Init creates a new environment
	Init(ctx context.Context, opts InitOptions) error

	// Install adds packages to an environment
	Install(ctx context.Context, opts InstallOptions) error

	// Remove removes packages from an environment
	Remove(ctx context.Context, opts RemoveOptions) error

	// List returns installed packages
	List(ctx context.Context, opts ListOptions) ([]Package, error)

	// Update updates packages in an environment
	Update(ctx context.Context, opts UpdateOptions) error

	// GetManifest returns the parsed manifest file
	GetManifest(ctx context.Context, envPath string) (*Manifest, error)
}

PackageManager is the interface that all package managers must implement

func New

func New(pmType string) (PackageManager, error)

New creates a package manager instance based on type

func NewWithPath

func NewWithPath(pmType string, customPath string) (PackageManager, error)

NewWithPath creates a package manager instance with a custom binary path

type RemoveOptions

type RemoveOptions struct {
	EnvPath   string    // Path to environment
	Packages  []string  // Package names to remove
	LogWriter io.Writer // Optional writer for streaming command output
}

RemoveOptions contains parameters for removing packages

type UpdateOptions

type UpdateOptions struct {
	EnvPath  string   // Path to environment
	Packages []string // Packages to update (empty = update all)
}

UpdateOptions contains parameters for updating packages

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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