commandManager

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const Branch_Master = "master"
View Source
const GIT_ASK_PASS = "/git-ask-pass.sh"
View Source
const ORIGIN_MASTER = "origin/master"

Variables

This section is empty.

Functions

func LocateGitRepo

func LocateGitRepo(path string) error

func ParseConfiguration

func ParseConfiguration() (*configuration, error)

Types

type BasicAuth

type BasicAuth struct {
	Username, Password string
}

BasicAuth represent a HTTP basic auth

func (*BasicAuth) ToBasicAuth

func (auth *BasicAuth) ToBasicAuth() *http.BasicAuth

type GitCliManagerImpl

type GitCliManagerImpl struct {
	*GitManagerBaseImpl
}

func (*GitCliManagerImpl) AddRepo

func (impl *GitCliManagerImpl) AddRepo(ctx GitContext, rootDir string, remoteUrl string, isBare bool) error

func (*GitCliManagerImpl) CommitAndPush

func (impl *GitCliManagerImpl) CommitAndPush(ctx GitContext, repoRoot, commitMsg, name, emailId string) (commitHash string, err error)

func (*GitCliManagerImpl) Pull

func (impl *GitCliManagerImpl) Pull(ctx GitContext, repoRoot string) (err error)

type GitCommandManager

type GitCommandManager interface {
	GitCommandManagerBase
	AddRepo(ctx GitContext, rootDir string, remoteUrl string, isBare bool) error
	CommitAndPush(ctx GitContext, repoRoot, commitMsg, name, emailId string) (string, error)
	Pull(ctx GitContext, repoRoot string) (err error)
}

func NewGitCommandManager

func NewGitCommandManager(logger *zap.SugaredLogger) GitCommandManager

type GitCommandManagerBase

type GitCommandManagerBase interface {
	Fetch(ctx GitContext, rootDir string) (response, errMsg string, err error)
	ListBranch(ctx GitContext, rootDir string) (response, errMsg string, err error)
	PullCli(ctx GitContext, rootDir string, branch string) (response, errMsg string, err error)
}

type GitContext

type GitContext struct {
	context.Context
	// contains filtered or unexported fields
}

func BuildGitContext

func BuildGitContext(ctx context.Context) GitContext

func (GitContext) WithCredentials

func (gitCtx GitContext) WithCredentials(auth *BasicAuth) GitContext

func (GitContext) WithTimeout

func (gitCtx GitContext) WithTimeout(timeoutSeconds int) (GitContext, context.CancelFunc)

type GitManagerBaseImpl

type GitManagerBaseImpl struct {
	// contains filtered or unexported fields
}

func (*GitManagerBaseImpl) Fetch

func (impl *GitManagerBaseImpl) Fetch(ctx GitContext, rootDir string) (response, errMsg string, err error)

func (*GitManagerBaseImpl) ListBranch

func (impl *GitManagerBaseImpl) ListBranch(ctx GitContext, rootDir string) (response, errMsg string, err error)

func (*GitManagerBaseImpl) PullCli

func (impl *GitManagerBaseImpl) PullCli(ctx GitContext, rootDir string, branch string) (response, errMsg string, err error)

type GoGitSDKManagerImpl

type GoGitSDKManagerImpl struct {
	*GitManagerBaseImpl
}

func (*GoGitSDKManagerImpl) AddRepo

func (impl *GoGitSDKManagerImpl) AddRepo(ctx GitContext, rootDir string, remoteUrl string, isBare bool) error

func (GoGitSDKManagerImpl) CommitAndPush

func (impl GoGitSDKManagerImpl) CommitAndPush(ctx GitContext, repoRoot, commitMsg, name, emailId string) (string, error)

func (GoGitSDKManagerImpl) Pull

func (impl GoGitSDKManagerImpl) Pull(ctx GitContext, repoRoot string) (err error)

Jump to

Keyboard shortcuts

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