forge

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 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

Overview

Package forge names the git hosts relgap reads tools from and builds links to their web pages.

Index

Constants

View Source
const (
	GitHub    = "github.com"
	Bitbucket = "bitbucket.org"
	GitLab    = "gitlab.com"
)

Known hosts. A tool without a host is on GitHub.

Variables

This section is empty.

Functions

func Canonical added in v0.12.0

func Canonical(host string) string

Canonical returns host in lowercase, with a forge's SSH host name replaced by its web host: Bitbucket Cloud's ssh.bitbucket.org and altssh.bitbucket.org, GitHub's ssh.github.com and GitLab.com's altssh.gitlab.com. git reaches the same repositories through them.

func CompareURL

func CompareURL(host, repo, from, to string) string

CompareURL returns the web page comparing tag from with tag to in repo on host.

func FileURL

func FileURL(host, repo, ref, path string) string

FileURL returns the web page of path in repo on host at ref; an empty ref means HEAD.

func IsGitHub

func IsGitHub(host string) bool

IsGitHub reports whether host is GitHub.

func LineURL

func LineURL(fileURL string, line int) string

LineURL returns fileURL with the anchor of line: #lines-N on Bitbucket Cloud, #LN elsewhere.

func RepoURL

func RepoURL(host, repo string) string

RepoURL returns the web page of repo on host.

func TagURL

func TagURL(host, repo, tag string) string

TagURL returns the web page of tag in repo on host.

Types

type Kind

type Kind string

Kind says which API a host speaks.

const (
	KindGitHub    Kind = "github"
	KindBitbucket Kind = "bitbucket"
	KindGitLab    Kind = "gitlab"
)

Host kinds.

func KindOf

func KindOf(host string) Kind

KindOf returns the kind of host: an empty host or github.com is GitHub, bitbucket.org is Bitbucket Cloud, and any other host is GitLab, because only GitLab hosts can be configured.

Jump to

Keyboard shortcuts

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