Documentation ¶
Index ¶
- func CheckIfFileExists(ctx context.Context, c interface{}, userName, repoName, branch, path string) (bool, error)
- func CreateBranch(ctx context.Context, c interface{}, ...) error
- func CreateRepo(ctx context.Context, c interface{}, repoName string, userName string, ...) error
- func DeleteBranch(ctx context.Context, c interface{}, userName, repoName, mergeBranch string) error
- func DeleteRepo(ctx context.Context, c interface{}, userName string, repoName string) error
- func GetFiles(ctx context.Context, c interface{}, userName string, repoName string, ...) ([]*gitprovider.CommitFile, error)
- func GetLatestCommitSHA(ctx context.Context, c interface{}, userName, repoName, branch, path string) (string, error)
- type Github
- func (p *Github) AddToCommit(path, content string, ref interface{}) interface{}
- func (p *Github) ClusterWatcher(ctx context.Context, cid, app, cluster string, waitTime int) error
- func (p *Github) CommitFiles(app, commitMessage string, files interface{}) error
- func (p *Github) CommitStatus(commitMessage, branchName, cid, app string, files interface{}) error
- func (p *Github) DeleteClusterStatusCR(ctx context.Context, cid, app, cluster string) error
- func (p *Github) DeleteToCommit(path string, ref interface{}) interface{}
- type GithubClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckIfFileExists ¶
func CheckIfFileExists(ctx context.Context, c interface{}, userName, repoName, branch, path string) (bool, error)
Function to check if file exists params : context, go git client, User Name, Repo Name, Branch, Path return : LatestCommit string, error
func CreateBranch ¶
func CreateBranch(ctx context.Context, c interface{}, latestCommitSHA, userName, repoName, branch string) error
function to create new branch from main params : context, go git client, latestCommitSHA, User Name, Repo Name, branch return : error
func CreateRepo ¶
func CreateRepo(ctx context.Context, c interface{}, repoName string, userName string, desc string) error
Function to create a new Repo in github params : context, github client, Repository Name, User Name, description return : nil/error
func DeleteBranch ¶
Function to delete the branch params : context, go git client, User Name, Repo Name, mergeBranch return : LatestCommit string, error
func DeleteRepo ¶
Function to delete repo params : context, github client , user name, repo name return : nil/error
func GetFiles ¶
func GetFiles(ctx context.Context, c interface{}, userName string, repoName string, branch string, path string) ([]*gitprovider.CommitFile, error)
Function to get files to the github repo params : context, github client, User Name, Repo Name, Branch Name, path) return : []*gitprovider.CommitFile, nil/error
Types ¶
type Github ¶
type Github struct { Url string Branch string UserName string RepoName string GitToken string Cluster string Client interface{} }
func (*Github) AddToCommit ¶
Function to Add file to the commit params : path , content, files (gitprovider commitfile array) return : files (gitprovider commitfile array)
func (*Github) ClusterWatcher ¶
func (*Github) CommitFiles ¶
Function to commit multiple files to the github repo params : context, github client, User Name, Repo Name, BranchName, Commit Message, files ([]gitprovider.CommitFile) return : nil/error
func (*Github) CommitStatus ¶
Function to commit multiple files to the github repo params : context, Branch Name, Commit Message, appName, files ([]gitprovider.CommitFile) return : nil/error
func (*Github) DeleteClusterStatusCR ¶
func (*Github) DeleteToCommit ¶
Function to Delete file from the commit params : path, files (gitprovider commitfile array) return : files (gitprovider commitfile array)
type GithubClient ¶
type GithubClient struct {
// contains filtered or unexported fields
}
func CreateClient ¶
func CreateClient(userName, githubToken string) (GithubClient, error)
Function to create githubClient params : github token return : github client, error