Documentation ¶
Index ¶
- func CheckoutBranch(folderName, branchName string) error
- func CreateBranch(folderName, branchName string) (*git.Branch, error)
- func DeleteBranch(repo *git.Repository, branchName string) error
- func GetFileContent(filePath string) (string, error)
- func GetFilesInPath(path string) ([]string, error)
- func GetLatestCommit(path, branchName string) (*git.Oid, error)
- func PushDeleteBranch(repo *git.Repository, branchName, userName, token string) error
- type CommitFile
- type Git2go
- func (p *Git2go) AddToCommit(fileName, content string, ref interface{}) interface{}
- func (p *Git2go) ClusterWatcher(ctx context.Context, cid, app, cluster string, waitTime int) error
- func (p *Git2go) CommitFiles(app, message string, files interface{}) error
- func (p *Git2go) CommitStatus(commitMessage, branchName, cid, app string, files interface{}) error
- func (p *Git2go) DeleteClusterStatusCR(cid, app, cluster string) error
- func (p *Git2go) DeleteToCommit(fileName string, ref interface{}) interface{}
- func (p *Git2go) GitPull(folderName, branchName string) error
- func (p *Git2go) PushBranch(repo *git.Repository, branchName string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckoutBranch ¶
function to checkout a branch
func CreateBranch ¶
function to create branch
func DeleteBranch ¶
func DeleteBranch(repo *git.Repository, branchName string) error
function to delete branch
func GetFileContent ¶
Function to get File Contents
func GetFilesInPath ¶
Function to get files in a path
func GetLatestCommit ¶
function to get the latest commit
func PushDeleteBranch ¶
func PushDeleteBranch(repo *git.Repository, branchName, userName, token string) error
function to push branch to remote origin
Types ¶
type CommitFile ¶
type CommitFile struct { // true if file is to be added and false for delete Add bool `json:"add"` // Path is path where this file is located. Path *string `json:"path"` FileName *string `json:"filename"` // Content is the content of the file. Content *string `json:"content,omitempty"` }
CommitFile contains high-level information about a file ed to a commit.
type Git2go ¶
type Git2go struct { Url string Branch string UserName string RepoName string GitToken string FolderName string }
func (*Git2go) AddToCommit ¶
function to add file to commit files array
func (*Git2go) ClusterWatcher ¶
func (*Git2go) CommitFiles ¶
function to commit files to a branch
func (*Git2go) CommitStatus ¶
function to commit files to a branch
func (*Git2go) DeleteClusterStatusCR ¶
DeleteClusterStatusCR deletes the status CR provided by the monitor on the cluster
func (*Git2go) DeleteToCommit ¶
function to delete file from commit files array
func (*Git2go) PushBranch ¶
func (p *Git2go) PushBranch(repo *git.Repository, branchName string) error
function to push branch to remote origin
Click to show internal directories.
Click to hide internal directories.