repos

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindPkgs deprecated

func FindPkgs(ctx context.Context, pkgs []string) (map[string][]db.Package, []string, error)

FindPkgs looks for packages matching the inputs inside the database. It returns a map that maps the package name input to any packages found for it. It also returns a slice that contains the names of all packages that were not found.

Deprecated: use struct method

func Pull deprecated

func Pull(ctx context.Context, repos []types.Repo) error

Pull pulls the provided repositories. If a repo doesn't exist, it will be cloned and its packages will be written to the DB. If it does exist, it will be pulled. In this case, only changed packages will be processed if possible. If repos is set to nil, the repos in the ALR config will be used.

Deprecated: use struct method

Types

type Config

type Config interface {
	GetPaths(ctx context.Context) *config.Paths
	Repos(ctx context.Context) []types.Repo
}

type Repos

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

func GetInstance deprecated

func GetInstance(ctx context.Context) *Repos

Deprecated: For legacy only

func New

func New(
	cfg Config,
	db *database.Database,
) *Repos

func (*Repos) FindPkgs

func (rs *Repos) FindPkgs(ctx context.Context, pkgs []string) (map[string][]db.Package, []string, error)

func (*Repos) Pull

func (rs *Repos) Pull(ctx context.Context, repos []types.Repo) error

Pull pulls the provided repositories. If a repo doesn't exist, it will be cloned and its packages will be written to the DB. If it does exist, it will be pulled. In this case, only changed packages will be processed if possible. If repos is set to nil, the repos in the ALR config will be used.

Jump to

Keyboard shortcuts

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