git

package
v0.0.0-...-6b00099 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 16 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.

func WithFS

func WithFS(fs billy.Filesystem) gitCloneTargetOption

WithFS allows customising the default filesystem manager. 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 {
	ClonePath string
	RepoURL   string
	Reference 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