prurl

package
v0.51.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: BSD-2-Clause Imports: 6 Imported by: 1 module, 2 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

This section is empty.

Functions

This section is empty.

Types

type PRInfo

type PRInfo struct {
	Platform Platform
	Host     string
	Owner    string // GitHub owner or Bitbucket project (used as owner equivalent)
	Project  string // Bitbucket project (same as Owner for Bitbucket, empty for GitHub)
	Repo     string
	Number   int
	RepoURL  string
}

PRInfo contains parsed information from a pull request URL.

func ParsePRURL

func ParsePRURL(ctx context.Context, rawURL string) (*PRInfo, error)

ParsePRURL parses a PR URL and extracts platform, host, owner/project, repo, PR number, and repo URL. Supports:

Returns error for unrecognized URL patterns or non-HTTPS URLs.

type Platform

type Platform string

Platform represents the type of PR platform.

const (
	// PlatformGitHub represents GitHub.
	PlatformGitHub Platform = "github"
	// PlatformBitbucket represents Bitbucket Server.
	PlatformBitbucket Platform = "bitbucket"
)

Jump to

Keyboard shortcuts

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