emcogit2go

package
v0.0.0-...-bb2f907 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 24, 2023 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckoutBranch

func CheckoutBranch(folderName, branchName string) error

function to checkout a branch

func CreateBranch

func CreateBranch(folderName, branchName string) (*git.Branch, error)

function to create branch

func DeleteBranch

func DeleteBranch(repo *git.Repository, branchName string) error

function to delete branch

func GetFileContent

func GetFileContent(filePath string) (string, error)

Function to get File Contents

func GetFilesInPath

func GetFilesInPath(path string) ([]string, error)

Function to get files in a path

func GetLatestCommit

func GetLatestCommit(path, branchName string) (*git.Oid, error)

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 NewGit2Go

func NewGit2Go(url, branch, user, repo, token string) (*Git2go, error)

func (*Git2go) AddToCommit

func (p *Git2go) AddToCommit(fileName, content string, ref interface{}) interface{}

function to add file to commit files array

func (*Git2go) ClusterWatcher

func (p *Git2go) ClusterWatcher(ctx context.Context, cid, app, cluster string, waitTime int) error

func (*Git2go) CommitFiles

func (p *Git2go) CommitFiles(app, message string, files interface{}) error

function to commit files to a branch

func (*Git2go) CommitStatus

func (p *Git2go) CommitStatus(commitMessage, branchName, cid, app string, files interface{}) error

function to commit files to a branch

func (*Git2go) DeleteClusterStatusCR

func (p *Git2go) DeleteClusterStatusCR(cid, app, cluster string) error

DeleteClusterStatusCR deletes the status CR provided by the monitor on the cluster

func (*Git2go) DeleteToCommit

func (p *Git2go) DeleteToCommit(fileName string, ref interface{}) interface{}

function to delete file from commit files array

func (*Git2go) GitPull

func (p *Git2go) GitPull(folderName, branchName string) error

function to pull branch

func (*Git2go) PushBranch

func (p *Git2go) PushBranch(repo *git.Repository, branchName string) error

function to push branch to remote origin

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL