Documentation ¶
Overview ¶
Copyright (C) 2021-2023, Kubefirst
This program is licensed under MIT. See the LICENSE file for more details.
Copyright (C) 2021-2023, Kubefirst ¶
This program is licensed under MIT. See the LICENSE file for more details.
Index ¶
- func VerifyTokenPermissions(githubToken string) error
- type GithubSession
- func (g GithubSession) AddSSHKey(keyTitle string, publicKey string) (*github.Key, error)
- func (g GithubSession) CheckRepoExists(owner string, name string) int
- func (g GithubSession) CheckTeamExists(owner string, name string) int
- func (g GithubSession) CommentPR(pullRequesrt *github.PullRequest, gitHubUser string, body string) error
- func (g GithubSession) CreatePR(branchName string, repoName string, gitHubUser string, baseBranch string, ...) (*github.PullRequest, error)
- func (g GithubSession) CreatePrivateRepo(org string, name string, description string) error
- func (g GithubSession) CreateWebhookRepo(org, repo, hookName, hookURL, hookSecret string, hookEvents []string) error
- func (g GithubSession) DeleteRepositoryWebhook(owner string, repository string, url string) error
- func (g GithubSession) GetRepo(owner string, name string) (*github.Repository, error)
- func (g GithubSession) IsRepoInUse(org string, name string) (bool, error)
- func (g GithubSession) ListRepoWebhooks(owner string, repo string) ([]*github.Hook, error)
- func (g GithubSession) RemoveRepo(owner string, name string) (*github.Response, error)
- func (g GithubSession) RemoveSSHKey(keyId int64) error
- func (g GithubSession) RemoveSSHKeyByPublicKey(user string, publicKey string) error
- func (g GithubSession) RemoveTeam(owner string, team string) error
- func (g GithubSession) RetrySearchPullRequestComment(gitHubUser string, gitOpsRepo string, pullRequest *github.PullRequest, ...) (bool, error)
- func (g GithubSession) SearchWordInPullRequestComment(gitHubUser string, gitOpsRepo string, pullRequest *github.PullRequest, ...) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyTokenPermissions ¶
VerifyTokenPermissions compares scope of the provided token to the required scopes for kubefirst functionality
Types ¶
type GithubSession ¶
type GithubSession struct {
// contains filtered or unexported fields
}
func (GithubSession) AddSSHKey ¶
AddSSHKey - Add ssh keys to a user account to allow kubefirst installer to use its own token during installation
func (GithubSession) CheckRepoExists ¶
func (g GithubSession) CheckRepoExists(owner string, name string) int
GetRepo - Always returns a status code for whether a repository exists or not
func (GithubSession) CheckTeamExists ¶
func (g GithubSession) CheckTeamExists(owner string, name string) int
GetRepo - Always returns a status code for whether a team exists or not
func (GithubSession) CommentPR ¶
func (g GithubSession) CommentPR(pullRequesrt *github.PullRequest, gitHubUser string, body string) error
func (GithubSession) CreatePR ¶
func (g GithubSession) CreatePR( branchName string, repoName string, gitHubUser string, baseBranch string, title string, body string) (*github.PullRequest, error)
func (GithubSession) CreatePrivateRepo ¶
func (g GithubSession) CreatePrivateRepo(org string, name string, description string) error
CreatePrivateRepo - Use github API to create a private repo
func (GithubSession) CreateWebhookRepo ¶
func (g GithubSession) CreateWebhookRepo(org, repo, hookName, hookURL, hookSecret string, hookEvents []string) error
func (GithubSession) DeleteRepositoryWebhook ¶
func (g GithubSession) DeleteRepositoryWebhook(owner string, repository string, url string) error
DeleteRepositoryWebhook
func (GithubSession) GetRepo ¶
func (g GithubSession) GetRepo(owner string, name string) (*github.Repository, error)
GetRepo - Returns a repo
func (GithubSession) IsRepoInUse ¶
func (g GithubSession) IsRepoInUse(org string, name string) (bool, error)
IsRepoInUse - Verify if a repo exists
func (GithubSession) ListRepoWebhooks ¶
ListRepoWebhooks returns all webhooks for a repository
func (GithubSession) RemoveRepo ¶
RemoveRepo Removes a repository based on repository owner and name. It returns github.Response that hold http data, as http status code, the caller can make use of the http status code to validate the response.
func (GithubSession) RemoveSSHKey ¶
func (g GithubSession) RemoveSSHKey(keyId int64) error
RemoveSSHKey - Removes SSH Key from github user
func (GithubSession) RemoveSSHKeyByPublicKey ¶
func (g GithubSession) RemoveSSHKeyByPublicKey(user string, publicKey string) error
RemoveSSHKeyByPublicKey deletes a GitHub key that matches the provided public key.
func (GithubSession) RemoveTeam ¶
func (g GithubSession) RemoveTeam(owner string, team string) error
RemoveTeam - Remove a team
func (GithubSession) RetrySearchPullRequestComment ¶
func (g GithubSession) RetrySearchPullRequestComment( gitHubUser string, gitOpsRepo string, pullRequest *github.PullRequest, searchFor string, logMessage string, ) (bool, error)
func (GithubSession) SearchWordInPullRequestComment ¶
func (g GithubSession) SearchWordInPullRequestComment(gitHubUser string, gitOpsRepo string, pullRequest *github.PullRequest, searchFor string) (bool, error)
SearchWordInPullRequestComment look for a specific sentence in a GitHub Pull Request comment