scope

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TypeGlobal = lockfile.ScopeGlobal
	TypeRepo   = lockfile.ScopeRepo
	TypePath   = lockfile.ScopePath
)

Re-export scope type constants from lockfile for convenience

Variables

This section is empty.

Functions

func GetInstallLocations

func GetInstallLocations(asset *lockfile.Asset, currentScope *Scope, repoRoot, globalBase string) []string

GetInstallLocations returns all installation base directories for an asset in the current context An asset can have multiple installation locations if it has multiple repository entries

func MatchRepoURLs

func MatchRepoURLs(url1, url2 string) bool

MatchRepoURLs checks if two repository URLs refer to the same repository

func NormalizeRepoURL

func NormalizeRepoURL(repoURL string) string

NormalizeRepoURL normalizes a repository URL for comparison

Types

type Matcher

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

Matcher matches assets based on scope

func NewMatcher

func NewMatcher(currentScope *Scope) *Matcher

NewMatcher creates a new scope matcher

func (*Matcher) MatchesAsset

func (m *Matcher) MatchesAsset(asset *lockfile.Asset) bool

MatchesAsset checks if an asset should be installed in the current scope An asset matches if: - It's global (no scopes) OR - It has a scope entry that matches the current context

type Scope

type Scope struct {
	Type     lockfile.ScopeType // TypeGlobal, TypeRepo, or TypePath
	RepoURL  string             // Repository URL (if in a repo)
	RepoPath string             // Path relative to repo root (if applicable)
}

Scope represents the current working context

Jump to

Keyboard shortcuts

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