cppkg

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IndexAutoUpdate is a flag to automatically update the index.
	IndexAutoUpdate = 1 << iota

	// ToolQuietInstall is a flag to suppress output during installation.
	ToolQuietInstall

	// LogRevertProxy is a flag to log revert proxy.
	LogRevertProxy
)
View Source
const (
	// DefaultFlags is the default flags for package installation.
	DefaultFlags = IndexAutoUpdate | ToolQuietInstall
)

Variables

View Source
var (
	// ErrVersionNotFound is returned when the specified version is not found.
	ErrVersionNotFound = errors.New("version not found")

	// ErrDynamicTag is returned when the tag is dynamic.
	ErrDynamicTag = errors.New("dynamic tag")
)
View Source
var (
	// ErrNotFound is the error resulting if a path search failed to find
	// an executable file.
	ErrNotFound = exec.ErrNotFound
)

Functions

func Install

func Install(pkgAndVer string, flags int)

Install installs a package with the given name and version. pkgAndVer: 7bitcoder/7bitconf@1.2.0

Types

type Manager

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

Manager represents a package manager for C/C++ packages.

func New

func New(cacheDir string) (ret *Manager, err error)

func (*Manager) Install

func (p *Manager) Install(pkg *Package, flags int) (err error)

Install installs the specified package using Conan.

func (*Manager) Lookup

func (p *Manager) Lookup(pkgPath, ver string, flags int) (_ *Package, err error)

Lookup looks up a package by its path and version.

type Package

type Package struct {
	Name     string
	Path     string
	Version  string
	Folder   string
	Template *Template
	// contains filtered or unexported fields
}

Package represents a C/C++ package.

type Template

type Template struct {
	FromVer string `yaml:"from"`
	Folder  string `yaml:"folder"`
	Tag     string `yaml:"tag,omitempty"` // pattern with *, empty if dynamic tag
}

Template represents a template for package versions.

type Tool

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

Tool represents a tool that can be executed.

func NewTool

func NewTool(cmd string, installs []string) *Tool

NewTool creates a new Tool instance with the specified tool and install commands.

func (*Tool) Get

func (p *Tool) Get(quietInstall bool) (app string, err error)

Get retrieves the path of the command. If the command is not found, it attempts to install it using the specified install commands.

func (*Tool) New

func (p *Tool) New(quietInstall bool, args ...string) (cmd *exec.Cmd, err error)

New creates a new command with the specified arguments.

Jump to

Keyboard shortcuts

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