catalog

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Catalog = make(map[string]scm.Repository)

Catalog contains a cached set of repositories and their metadata from Bitbucket

View Source
var Labels = make(map[string]mapset.Set[string])

Labels contains a mapping of label names with the set of repositories matching each label

Functions

func CompletionFunc added in v0.9.6

func CompletionFunc() cobra.CompletionFunc

CompletionFunc provides shell completion suggestions based on the currently-known repositories and labels.

func GetProjectForRepo added in v0.9.6

func GetProjectForRepo(ctx context.Context, repoName string) string

GetProjectForRepo returns the project for a given repository name. It checks the catalog first, then falls back to the default project.

func GetRepository added in v0.9.6

func GetRepository(ctx context.Context, repoName string) (*scm.Repository, bool)

GetRepository retrieves a repository from the catalog by name. It attempts to find the repository using different lookup strategies: 1. Direct lookup (if repo contains project/name) 2. Lookup with default project prefix 3. Search through all catalog entries for matching name

func Init

func Init(ctx context.Context, flush bool)

Init initializes the repository catalog and label mappings, updating the cache if necessary (based on configured TTL).

func NoCompletion added in v0.9.6

func NoCompletion() cobra.CompletionFunc

NoCompletion provides a no-op completion function to disable file completions for interstitial commands.

func RepositoryList

func RepositoryList(ctx context.Context, filters ...string) mapset.Set[string]

RepositoryList returns the set of repository names matching the given filters.

Types

type Label added in v0.9.6

type Label struct {
	mapset.Set[string]
}

Label represents a logical grouping of repository names.

func (*Label) String added in v0.9.6

func (l *Label) String() string

String provides a set-theory representation of the Label.

type LabelGroup added in v0.9.6

type LabelGroup struct {
	Forced   Label
	Included Label
	Excluded Label
}

LabelGroup holds categorized label names extracted from a list of filter arguments.

func ParseLabels added in v0.9.6

func ParseLabels(ctx context.Context, filters ...string) (LabelGroup, []string)

ParseLabels constructs a parsed group of labels based on the provided filters, along with the list of matching repositories from the local cache.

func (LabelGroup) String added in v0.9.6

func (lg LabelGroup) String() string

String provides a set-theory representation of the LabelGroup.

(forced ∪ (included ∖ excluded))

func (LabelGroup) ToSlices added in v0.9.6

func (lg LabelGroup) ToSlices() (forced, included, excluded []string)

ToSlices converts the LabelGroup sets to sorted slices.

Jump to

Keyboard shortcuts

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