prurl

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: BSD-2-Clause Imports: 6 Imported by: 0

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