git

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewManager

func NewManager(conf *Conf) (*manager, error)

NewManager returns a new default clone manager.

func NewTarget

func NewTarget(conf *Conf, opts ...gitCloneTargetOption) (*gitCloneTarget, error)

NewTarget returns a new git clone target.

func WithClock

func WithClock(clock clockwork.Clock) gitCloneTargetOption

WithClock allows customising the default clock. Mainly used for testing.

func WithCloner

func WithCloner(cloner Cloner) gitCloneTargetOption

WithCloner allows customising the default cloner. Mainly used for testing.

Types

type Cloner

type Cloner interface {
	Clone(ctx context.Context) (*Repository, error)
}

Cloner is the contract for cloning repositories.

type Conf

type Conf struct {
	RepoURL   string
	Reference string
	ClonePath string

	ConfAuth ConfAuth
}

Conf wraps the component configuration.

func NewConf

func NewConf(envLoader env.Loader) (*Conf, error)

NewConf returns a new configuration build from environment lookup.

type ConfAuth

type ConfAuth struct {
	Username    string
	AuthEnabled bool
	AccessToken string
}

ConfAuth contains authentication configuration.

type Repository

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

Repository wraps a git repository to not leak deps.

Jump to

Keyboard shortcuts

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