Help us shape the future of Go! Take the 2026 Go Developer Survey

matcher

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 5 Imported by: 0

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