Documentation
¶
Index ¶
- Variables
- func GetBaseUrl(repoUrl string) (string, error)
- type FailedToParseUrlError
- type GitlabClient
- func (g *GitlabClient) DeleteBranch(repoUrl, branchName string) (bool, error)
- func (g *GitlabClient) DeletePaCWebhook(repoUrl, webhookUrl string) error
- func (g *GitlabClient) EnsurePaCMergeRequest(repoUrl string, d *gp.MergeRequestData) (webUrl string, err error)
- func (g *GitlabClient) FindUnmergedPaCMergeRequest(repoUrl string, d *gp.MergeRequestData) (*gp.MergeRequest, error)
- func (g *GitlabClient) GetBranchSha(repoUrl, branchName string) (string, error)
- func (g *GitlabClient) GetBrowseRepositoryAtShaLink(repoUrl, sha string) string
- func (g *GitlabClient) GetConfiguredGitAppName() (string, string, error)
- func (g *GitlabClient) GetDefaultBranch(repoUrl string) (string, error)
- func (g *GitlabClient) IsFileExist(repoUrl, branchName, filePath string) (bool, error)
- func (g *GitlabClient) IsRepositoryPublic(repoUrl string) (bool, error)
- func (g *GitlabClient) SetupPaCWebhook(repoUrl, webhookUrl, webhookSecret string) error
- func (g *GitlabClient) UndoPaCMergeRequest(repoUrl string, d *gp.MergeRequestData) (webUrl string, err error)
- type MissingHostError
- type MissingSchemaError
Constants ¶
This section is empty.
Variables ¶
var NewGitlabClient func(accessToken, baseUrl string) (*GitlabClient, error) = newGitlabClient
Allow mocking for tests
var NewGitlabClientWithBasicAuth func(username, password, baseUrl string) (*GitlabClient, error) = newGitlabClientWithBasicAuth
Functions ¶
func GetBaseUrl ¶
Types ¶
type FailedToParseUrlError ¶
type FailedToParseUrlError struct {
// contains filtered or unexported fields
}
func (FailedToParseUrlError) Error ¶
func (e FailedToParseUrlError) Error() string
type GitlabClient ¶
type GitlabClient struct {
// contains filtered or unexported fields
}
func (*GitlabClient) DeleteBranch ¶
func (g *GitlabClient) DeleteBranch(repoUrl, branchName string) (bool, error)
DeleteBranch deletes given branch from repository
func (*GitlabClient) DeletePaCWebhook ¶
func (g *GitlabClient) DeletePaCWebhook(repoUrl, webhookUrl string) error
DeletePaCWebhook deletes Pipelines as Code webhook in the given repository
func (*GitlabClient) EnsurePaCMergeRequest ¶
func (g *GitlabClient) EnsurePaCMergeRequest(repoUrl string, d *gp.MergeRequestData) (webUrl string, err error)
EnsurePaCMergeRequest creates or updates existing (if needed) Pipelines as Code configuration proposal merge request. Returns the merge request web URL. If there is no error and web URL is empty, it means that the merge request is not needed (main branch is up to date).
func (*GitlabClient) FindUnmergedPaCMergeRequest ¶
func (g *GitlabClient) FindUnmergedPaCMergeRequest(repoUrl string, d *gp.MergeRequestData) (*gp.MergeRequest, error)
FindUnmergedPaCMergeRequest searches for existing Pipelines as Code configuration proposal merge request
func (*GitlabClient) GetBranchSha ¶
func (g *GitlabClient) GetBranchSha(repoUrl, branchName string) (string, error)
GetBranchSha returns SHA of top commit in the given branch
func (*GitlabClient) GetBrowseRepositoryAtShaLink ¶
func (g *GitlabClient) GetBrowseRepositoryAtShaLink(repoUrl, sha string) string
GetBrowseRepositoryAtShaLink returns web URL of repository state at given SHA
func (*GitlabClient) GetConfiguredGitAppName ¶
func (g *GitlabClient) GetConfiguredGitAppName() (string, string, error)
func (*GitlabClient) GetDefaultBranch ¶
func (g *GitlabClient) GetDefaultBranch(repoUrl string) (string, error)
GetDefaultBranch returns name of default branch in the given repository
func (*GitlabClient) IsFileExist ¶
func (g *GitlabClient) IsFileExist(repoUrl, branchName, filePath string) (bool, error)
IsFileExist check whether given file exists in the given branch of the reposiotry. If branch is empty string, default branch is used.
func (*GitlabClient) IsRepositoryPublic ¶
func (g *GitlabClient) IsRepositoryPublic(repoUrl string) (bool, error)
IsRepositoryPublic returns true if the repository could be accessed without authentication
func (*GitlabClient) SetupPaCWebhook ¶
func (g *GitlabClient) SetupPaCWebhook(repoUrl, webhookUrl, webhookSecret string) error
SetupPaCWebhook creates Pipelines as Code webhook in the given repository
func (*GitlabClient) UndoPaCMergeRequest ¶
func (g *GitlabClient) UndoPaCMergeRequest(repoUrl string, d *gp.MergeRequestData) (webUrl string, err error)
UndoPaCMergeRequest creates or updates existing Pipelines as Code configuration removal merge request. Returns the merge request web URL. If there is no error and web URL is empty, it means that the merge request is not needed (the configuraton has already been deleted).
type MissingHostError ¶
type MissingHostError struct {
// contains filtered or unexported fields
}
func (MissingHostError) Error ¶
func (e MissingHostError) Error() string
type MissingSchemaError ¶
type MissingSchemaError struct {
// contains filtered or unexported fields
}
func (MissingSchemaError) Error ¶
func (e MissingSchemaError) Error() string