vfsutils

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CodeMountingError = func(err error) error {
		return errors.Wrapf(err, "error mounting code")
	}

	ReadFileError = func(err error, path string) error {
		return errors.Wrapf(err, "error reading file %s", path)
	}

	ListFilesError = func(err error, path string) error {
		return errors.Wrapf(err, "error listing files of %s", path)
	}

	InvalidDefinitionError = func(msg string) error {
		return eris.New(msg)
	}
)

Functions

func MountCode

func MountCode(fs afero.Fs, ctx context.Context, client *github.Client, owner, repo, ref string) (dir string, err error)

func MountTar

func MountTar(fs afero.Fs, tarUrl string) (dir string, err error)

Types

type MountedRepo

type MountedRepo interface {
	GetOwner() string
	GetRepo() string
	GetSha() string
	GetFileContents(ctx context.Context, path string) ([]byte, error)
	ListFiles(ctx context.Context, path string) ([]os.FileInfo, error)
}

func NewLazilyMountedRepo

func NewLazilyMountedRepo(client *github.Client, owner, repo, sha string) MountedRepo

func NewLocalMountedRepoForFs added in v0.10.16

func NewLocalMountedRepoForFs(repoRootPath, owner, repo string) (MountedRepo, error)

Creates a mounted repo for a local filesystem, the code must already be checked out at the correct SHA, which is not known from this implementation.

Jump to

Keyboard shortcuts

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