Documentation ¶
Index ¶
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
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 ResolveRemotesToRepos(remotes Remotes, client *gitlab.Client, base string) (*ResolvedRemotes, error)
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