Documentation
¶
Index ¶
- Constants
- func GetDeleteProjectOptions() *gitlab.DeleteProjectOptions
- func GetFileContents(t *testing.T, path string) []byte
- func GetRandomStringFromSetup(t *testing.T) string
- func LastElement(str, sep string) string
- type GitHubClient
- func (gh *GitHubClient) ClosePullRequest(ctx context.Context, pr *github.PullRequest)
- func (gh *GitHubClient) CreatePullRequest(ctx context.Context, title, branch, base string) *github.PullRequest
- func (gh *GitHubClient) GetOpenPullRequest(ctx context.Context, branch string) *github.PullRequest
- func (gh *GitHubClient) GetRepository(ctx context.Context) *github.Repository
- func (gh *GitHubClient) MergePullRequest(ctx context.Context, pr *github.PullRequest, commitTitle, commitMessage string) *github.PullRequestMergeResult
- type GitLabClient
- func (gl *GitLabClient) AcceptMergeRequest(mr *gitlab.MergeRequest, commitMessage string) *gitlab.MergeRequest
- func (gl *GitLabClient) CloseMergeRequest(mr *gitlab.MergeRequest)
- func (gl *GitLabClient) CreateMergeRequest(title, branch, base string) *gitlab.MergeRequest
- func (gl *GitLabClient) DeleteWebhookByKey(webhookKey string)
- func (gl *GitLabClient) GetOpenMergeRequest(branch string) *gitlab.MergeRequest
- func (gl *GitLabClient) GetProject() *gitlab.Project
- func (gl *GitLabClient) ProjectName() string
Constants ¶
View Source
const ( GitHubOwner = "infra-manager-bootstrap-module" GitHubAppID = "68754904" // Found in the URL of your Cloud Build GitHub app configuration settings )
View Source
const (
GitlabGroup = "terraform-google-bootstrap"
)
Variables ¶
This section is empty.
Functions ¶
func GetDeleteProjectOptions ¶
func GetDeleteProjectOptions() *gitlab.DeleteProjectOptions
GetDeleteProjectOptions returns default DeleteProjectOptions
func GetFileContents ¶
GetFileContents returns the contents of a given file.
func GetRandomStringFromSetup ¶
GetRandomStringFromSetup gets a random string output variable setup.
func LastElement ¶
LastElement gets the last element in a string separated by sep. Typically used to grab a resource ID from a full resource name.
Types ¶
type GitHubClient ¶
type GitHubClient struct {
Repository *github.Repository
// contains filtered or unexported fields
}
func NewGitHubClient ¶
func NewGitHubClient(t *testing.T, token, repo string) *GitHubClient
func (*GitHubClient) ClosePullRequest ¶
func (gh *GitHubClient) ClosePullRequest(ctx context.Context, pr *github.PullRequest)
func (*GitHubClient) CreatePullRequest ¶
func (gh *GitHubClient) CreatePullRequest(ctx context.Context, title, branch, base string) *github.PullRequest
func (*GitHubClient) GetOpenPullRequest ¶
func (gh *GitHubClient) GetOpenPullRequest(ctx context.Context, branch string) *github.PullRequest
GetOpenPullRequest gets an open pull request for a given branch if it exists.
func (*GitHubClient) GetRepository ¶
func (gh *GitHubClient) GetRepository(ctx context.Context) *github.Repository
func (*GitHubClient) MergePullRequest ¶
func (gh *GitHubClient) MergePullRequest(ctx context.Context, pr *github.PullRequest, commitTitle, commitMessage string) *github.PullRequestMergeResult
type GitLabClient ¶
func NewGitLabClient ¶
func NewGitLabClient(t *testing.T, token, projectName string) *GitLabClient
func (*GitLabClient) AcceptMergeRequest ¶
func (gl *GitLabClient) AcceptMergeRequest(mr *gitlab.MergeRequest, commitMessage string) *gitlab.MergeRequest
func (*GitLabClient) CloseMergeRequest ¶
func (gl *GitLabClient) CloseMergeRequest(mr *gitlab.MergeRequest)
func (*GitLabClient) CreateMergeRequest ¶
func (gl *GitLabClient) CreateMergeRequest(title, branch, base string) *gitlab.MergeRequest
func (*GitLabClient) DeleteWebhookByKey ¶
func (gl *GitLabClient) DeleteWebhookByKey(webhookKey string)
DeleteWebhookByKey deletes webhooks for the project that contain the given key in their URL.
func (*GitLabClient) GetOpenMergeRequest ¶
func (gl *GitLabClient) GetOpenMergeRequest(branch string) *gitlab.MergeRequest
GetOpenMergeRequest gets the last opened merge request for a given branch if it exists.
func (*GitLabClient) GetProject ¶
func (gl *GitLabClient) GetProject() *gitlab.Project
func (*GitLabClient) ProjectName ¶
func (gl *GitLabClient) ProjectName() string
Click to show internal directories.
Click to hide internal directories.