git

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package git is used for encapsulating all the interaction with Git

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Walk

func Walk(fs billy.Filesystem, root string, walkFn filepath.WalkFunc) error

Walk walks the file tree rooted at root, calling fn for each file or directory in the tree, including root. All errors that arise visiting files and directories are filtered by fn: see the WalkFunc documentation for details.

The files are walked in lexical order, which makes the output deterministic but requires Walk to read an entire directory into memory before proceeding to walk that directory. Walk does not follow symbolic links.

Function adapted from https://github.com/golang/go/blob/3b770f2ccb1fa6fecc22ea822a19447b10b70c5c/src/path/filepath/path.go#L500

Types

type File

type File struct {
	io.ReadCloser
	// contains filtered or unexported fields
}

func GetFilesForPackage

func GetFilesForPackage(log logger.LogInterface, filesGetter FilesGetter, pkg v1alpha1.Package) ([]*File, error)

GetFilesForPackage clones the package in memory

func NewFile

func NewFile(path string, baseFolder string, fs billy.Filesystem) *File

func (*File) Close

func (f *File) Close() error

func (*File) FilePath

func (f *File) FilePath() string

func (*File) Open

func (f *File) Open() error

func (*File) Read

func (f *File) Read(p []byte) (n int, err error)

func (*File) String

func (f *File) String() string

type FilesGetter

type FilesGetter interface {
	WorkTreeForPackage(pkg v1alpha1.Package) (*billy.Filesystem, error)
}

type RealFilesGetter

type RealFilesGetter struct{}

func (RealFilesGetter) WorkTreeForPackage

func (filesGetter RealFilesGetter) WorkTreeForPackage(pkg v1alpha1.Package) (*billy.Filesystem, error)

Jump to

Keyboard shortcuts

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