Documentation
¶
Index ¶
- func FullNameFromURL(remoteURL string) (string, error)
- func IsSame(a, b Interface) bool
- func RemoteURL(project *gitlab.Project, protocol string) string
- type Interface
- func FromFullName(nwo string) (Interface, error)
- func FromURL(u *url.URL) (Interface, error)
- func New(owner, repo string) Interface
- func NewWithGroup(group, namespace, repo, hostname string) Interface
- func NewWithHost(owner, repo, hostname string) Interface
- func TestProject(owner, repo string) Interface
- type Project
- type Remote
- type Remotes
- type ResolvedRemotes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FullNameFromURL ¶
FullName returns the the repo with its namespace (like profclems/glab). Respects group and subgroups names
Types ¶
type Interface ¶
type Interface interface { RepoName() string RepoOwner() string RepoNamespace() string RepoGroup() string RepoHost() string FullName() string Project(*gitlab.Client) (*gitlab.Project, error) }
Interface describes an object that represents a GitLab repository Contains methods for these methods representing these placeholders for a project path with :host/:group/:namespace/:repo RepoHost = :host, RepoOwner = :group/:namespace, RepoNamespace = :namespace, FullName = :group/:namespace/:repo, RepoGroup = :group, RepoName = :repo
func FromFullName ¶
FromFullName extracts the GitLab repository information from the following formats: "OWNER/REPO", "HOST/OWNER/REPO", "HOST/GROUP/NAMESPACE/REPO", and a full URL.
func NewWithGroup ¶
NewWithGroup instantiates a GitLab repository from group, namespace and repo name arguments
func NewWithHost ¶
NewWithHost is like New with an explicit host name
func TestProject ¶ added in v1.50.0
type Remote ¶
Remote represents a git remote mapped to a GitLab repository
func (Remote) RepoNamespace ¶
type Remotes ¶
type Remotes []*Remote
Remotes represents a set of git remotes
func TranslateRemotes ¶
func TranslateRemotes(gitRemotes git.RemoteSet, urlTranslate func(*url.URL) *url.URL) (remotes Remotes)
TODO: accept an interface instead of git.RemoteSet
func (Remotes) FindByName ¶
FindByName returns the first Remote whose name matches the list
func (Remotes) FindByRepo ¶
FindByRepo returns the first Remote that points to a specific GitLab repository
func (Remotes) UniqueHosts ¶ added in v1.30.0
UniqueHosts returns a string of unique hostnames
type ResolvedRemotes ¶
type ResolvedRemotes struct {
// contains filtered or unexported fields
}
func ResolveRemotesToRepos ¶
func (*ResolvedRemotes) BaseRepo ¶
func (r *ResolvedRemotes) BaseRepo(interactive bool) (Interface, error)
func (*ResolvedRemotes) HeadRepo ¶
func (r *ResolvedRemotes) HeadRepo(interactive bool) (Interface, error)
func (*ResolvedRemotes) RemoteForRepo ¶
func (r *ResolvedRemotes) RemoteForRepo(repo Interface) (*Remote, error)
RemoteForRepo finds the git remote that points to a repository