hosting_service

package
v0.62.2 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 9 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostingServiceMgr

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

func NewHostingServiceMgr

func NewHostingServiceMgr(log logrus.FieldLogger, tr *i18n.TranslationSet, remoteURL string, configServiceDomains map[string]string) *HostingServiceMgr

NewHostingServiceMgr creates new instance of PullRequest

func (*HostingServiceMgr) GetCommitURL

func (self *HostingServiceMgr) GetCommitURL(commitHash string) (string, error)

func (*HostingServiceMgr) GetPullRequestURL

func (self *HostingServiceMgr) GetPullRequestURL(from string, to string) (string, error)

func (*HostingServiceMgr) GetRepoName added in v0.61.0

func (self *HostingServiceMgr) GetRepoName() (string, error)

e.g. 'jesseduffield/lazygit'

func (*HostingServiceMgr) GetServiceInfo added in v0.62.0

func (self *HostingServiceMgr) GetServiceInfo() (ServiceInfo, error)

GetServiceInfo identifies which hosting service the configured remote URL belongs to and returns enough information to talk to its web/API host.

type RepoInformation

type RepoInformation struct {
	Owner      string
	Repository string
}

RepoInformation holds the owner and repository name parsed from a remote URL.

func GetRepoInfoFromURL added in v0.61.0

func GetRepoInfoFromURL(url string) (RepoInformation, error)

GetRepoInfoFromURL parses a remote URL (SSH or HTTPS) and extracts the owner and repository name using the default URL regex patterns.

type Service

type Service struct {
	ServiceDefinition
	// contains filtered or unexported fields
}

type ServiceDefinition

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

type ServiceDomain

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

a service domains pairs a service definition with the actual domain it's being served from. Sometimes the git service is hosted in a custom domains so although it'll use say the github service definition, it'll actually be served from e.g. my-custom-github.com

type ServiceInfo added in v0.62.0

type ServiceInfo struct {
	Provider   string // e.g. "github"
	WebDomain  string // e.g. "github.com", or "git.acme.com" for an on-prem instance
	Owner      string // e.g. "jesseduffield"
	Repository string // e.g. "lazygit"
	RepoName   string // e.g. "jesseduffield/lazygit"
}

ServiceInfo holds the resolved hosting service for a remote URL. Owner comes from the "owner" named regex capture, which only exists for owner/repo-shaped providers (github, gitlab, bitbucket, gitea, codeberg); it's empty for azuredevops and bitbucketServer, whose URLs are organised differently. Repository is populated for every provider, but RepoName may have more than two segments (e.g. "org/project/repo" for azuredevops).

Jump to

Keyboard shortcuts

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