git

package
v0.0.0-...-696ba86 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UsernameKey = "username"
	PasswordKey = "password"
	KeyKey      = "key"
)

Variables

This section is empty.

Functions

func GetAuth

func GetAuth(options *AuthOptions) (git2go.RemoteCallbacks, error)

func IsAuthErr

func IsAuthErr(err error) bool

func IsNotRecoverableError

func IsNotRecoverableError(err error) bool

func NewGit2Go

func NewGit2Go(logger *zap.SugaredLogger) *git2GoClient

Types

type AuthOptions

type AuthOptions struct {
	Type        RepositoryAuthType
	Credentials map[string]string
	SecretName  string
}

type GitClient

type GitClient interface {
	LastCommit(options Options) (string, error)
	Clone(path string, options Options) (string, error)
}

type GitClientFactory

type GitClientFactory struct {
}

func (GitClientFactory) GetGitClient

func (f GitClientFactory) GetGitClient(logger *zap.SugaredLogger) GitClient

type Options

type Options struct {
	URL       string
	Reference string
	Auth      *AuthOptions
}

type RepositoryAuthType

type RepositoryAuthType string
const (
	RepositoryAuthBasic  RepositoryAuthType = "basic"
	RepositoryAuthSSHKey RepositoryAuthType = "key"
)

Jump to

Keyboard shortcuts

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