repository

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Copy

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

Copy copy implementation.

func NewCopy

func NewCopy(
	appFs afero.Fs,
	logger *slog.Logger,
) *Copy

NewCopy factory to create a new copy instance.

func (*Copy) CopyDir

func (r *Copy) CopyDir(
	src string,
	dst string,
) (err error)

CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.

func (*Copy) CopyFile

func (r *Copy) CopyFile(
	src string,
	dst string,
) (err error)

CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.

type CopyManager

type CopyManager interface {
	CopyDir(src string, dst string) error
	CopyFile(src string, dst string) error
}

CopyManager manager responsible for Copy operations.

type Repository

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

Repository contains the repository's details for cloning.

func New

func New(
	appFs afero.Fs,
	copyManager CopyManager,
	gitManager internal.GitManager,
	logger *slog.Logger,
) *Repository

New factory to create a new Repository instance.

func (*Repository) Clone

func (r *Repository) Clone(
	c config.Repository,
	cloneDir string,
) (string, error)

Clone Repository.Git under Repository.getCloneDir

func (*Repository) CopySources

func (r *Repository) CopySources(
	c config.Repository,
	cloneDir string,
) error

CopySources copy Repository.Src to Repository.DstFile or Repository.DstDir.

func (*Repository) Worktree added in v1.0.2

func (r *Repository) Worktree(
	c config.Repository,
	cloneDir string,
	targetDir string,
) error

Create a Workingtree at the given version in Repository.DstDir.

Jump to

Keyboard shortcuts

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