git

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Git

type Git interface {
	// Clone takes the given GitRepo reference and clones the repo
	// with its internal implementation.
	Clone(ctx context.Context) error
}

type GitRepo

type GitRepo interface {
	GetName() string
	GetCloneURL() *url.URL
	GetBranch() string
	GetLocalPath() string
	GetTag() string
	SetTag(string)
	SetBranch(string)
	SetLocalPath(string)
}

func NewRepo

func NewRepo(urlPath string) (GitRepo, error)

NewRepo parses the given git urlPath and returns an interface that is backed by Github or Gitlab repo implementations.

type GitRepoStruct

type GitRepoStruct struct {
	// CloneURL is the URL that will be used for cloning the repo
	CloneURL       *url.URL
	RepositoryName string
	// GitBranch is the referenced Git branch name.
	GitBranch string
	// Tag name - either tag or branch should be set.
	Tag           string
	LocalRepoPath string
}

GitRepoStruct is a struct that contains all the fields required for a GitRepo instance.

func (*GitRepoStruct) GetBranch

func (u *GitRepoStruct) GetBranch() string

GetBranch returns the referenced Git branch name. the empty string is returned otherwise.

func (*GitRepoStruct) GetCloneURL

func (u *GitRepoStruct) GetCloneURL() *url.URL

GetCloneURL returns the CloneURL of the repository.

func (*GitRepoStruct) GetLocalPath

func (u *GitRepoStruct) GetLocalPath() string

func (*GitRepoStruct) GetName

func (u *GitRepoStruct) GetName() string

GetName returns the repository name.

func (*GitRepoStruct) GetTag

func (u *GitRepoStruct) GetTag() string

func (*GitRepoStruct) SetBranch

func (u *GitRepoStruct) SetBranch(b string)

func (*GitRepoStruct) SetLocalPath

func (u *GitRepoStruct) SetLocalPath(p string)

func (*GitRepoStruct) SetTag

func (u *GitRepoStruct) SetTag(t string)

type GoGit

type GoGit struct {
	ProxyURL *url.URL
	// contains filtered or unexported fields
}

func NewGoGit

func NewGoGit(gitRepo GitRepo, secret types.NamespacedName, credentialResolver auth.CredentialResolver) *GoGit

func (*GoGit) Clone

func (g *GoGit) Clone(ctx context.Context) error

Clone takes the given GitRepo reference and clones the repo with its internal implementation.

func (*GoGit) SetProxy added in v0.0.30

func (g *GoGit) SetProxy(p string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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