matcher

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoMatchingApp = errors.New("no matching GitHub App found")

ErrNoMatchingApp is returned when no GitHub App matches the repository URL

Functions

This section is empty.

Types

type Matcher

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

Matcher handles pattern matching for GitHub App configurations

func NewMatcher

func NewMatcher(apps []config.GitHubApp) *Matcher

NewMatcher creates a new pattern matcher with the given GitHub App configurations

func (*Matcher) Match

func (m *Matcher) Match(repositoryURL string) (*config.GitHubApp, error)

Match finds the best matching GitHub App for the given repository URL Uses longest prefix matching - the app with the longest matching path prefix wins If scope information is available, validates that the repo is within the app's installation scope

type RepositoryInfo

type RepositoryInfo struct {
	Host       string
	Owner      string
	Repository string
	FullPath   string // host/owner/repo
	URL        string // original URL
}

RepositoryInfo contains parsed repository information

func GetRepositoryInfo

func GetRepositoryInfo(repoURL string) (*RepositoryInfo, error)

GetRepositoryInfo parses repository URL and returns the info (for testing/debugging)

Jump to

Keyboard shortcuts

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