pkg

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

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const SeparatorString = string(filepath.Separator)

Variables

View Source
var (
	ErrNoTreeLikeSpecified   = errors.New("cannot identify tree")
	ErrCannotListCommit      = errors.New("cannot list commit")
	ErrMultipleRefsSpecified = errors.New("only specify Commit, Branch, or Tag")
)
View Source
var (
	ErrEscapesChroot = errors.New("attempted to resolve path that escapes chroot")
	ErrNoMatch       = errors.New("pattern does not match")
)

Functions

func NewBillyFuse

func NewBillyFuse(fs billy.Filesystem) (fuseutil.FileSystem, error)

func NewBillyFuseServer

func NewBillyFuseServer(fs billy.Filesystem) (fuse.Server, error)

func NewReferenceFileSystem

func NewReferenceFileSystem(git Git, reference GitReference) billy.Filesystem

Types

type FilePath

type FilePath struct {
	Path []string
	// contains filtered or unexported fields
}

func RootGitPath

func RootGitPath() FilePath

func (*FilePath) ConsumeMatches

func (p *FilePath) ConsumeMatches(pattern ...string) ([]string, FilePath, error)

func (*FilePath) IsRoot

func (p *FilePath) IsRoot() bool

func (*FilePath) Parent

func (p *FilePath) Parent() FilePath

func (*FilePath) Resolve

func (p *FilePath) Resolve(request string) (FilePath, error)

func (*FilePath) String

func (p *FilePath) String() string

type Git

type Git interface {
	ListTree(path GitPath, handler func(entry gitism.TreeEntry) error) error
	ListBranches(handler func(branch string) error) error
	ListTags(handler func(branch string) error) error
	ListCommits(ref GitReference, handler func(branch string) error) error
	ReadBlob(hash string) ([]byte, error)
}

func NewCliGit

func NewCliGit(gitDirectory string) (Git, error)

type GitPath

type GitPath struct {
	Reference GitReference
	TreePath  string
}

type GitReference

type GitReference struct {
	Commit, Branch, Tag *string
}

type ReferenceFileSystem

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

func (ReferenceFileSystem) Capabilities

func (s ReferenceFileSystem) Capabilities() billy.Capability

func (ReferenceFileSystem) Chmod

func (s ReferenceFileSystem) Chmod(name string, mode os.FileMode) error

func (ReferenceFileSystem) Chown

func (s ReferenceFileSystem) Chown(name string, uid, gid int) error

func (ReferenceFileSystem) Chroot

func (s ReferenceFileSystem) Chroot(path string) (billy.Filesystem, error)

func (ReferenceFileSystem) Chtimes

func (s ReferenceFileSystem) Chtimes(name string, atime time.Time, mtime time.Time) error

func (ReferenceFileSystem) Create

func (s ReferenceFileSystem) Create(filename string) (billy.File, error)

func (ReferenceFileSystem) Join

func (s ReferenceFileSystem) Join(elem ...string) string

func (ReferenceFileSystem) Lchown

func (s ReferenceFileSystem) Lchown(name string, uid, gid int) error

func (ReferenceFileSystem) Lstat

func (s ReferenceFileSystem) Lstat(filename string) (os.FileInfo, error)

func (ReferenceFileSystem) MkdirAll

func (s ReferenceFileSystem) MkdirAll(filename string, perm os.FileMode) error

func (ReferenceFileSystem) Open

func (s ReferenceFileSystem) Open(filename string) (billy.File, error)

func (ReferenceFileSystem) OpenFile

func (s ReferenceFileSystem) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error)

func (ReferenceFileSystem) ReadDir

func (s ReferenceFileSystem) ReadDir(path string) ([]os.FileInfo, error)
func (s ReferenceFileSystem) Readlink(link string) (string, error)

func (ReferenceFileSystem) Remove

func (s ReferenceFileSystem) Remove(filename string) error

func (ReferenceFileSystem) Rename

func (s ReferenceFileSystem) Rename(oldpath, newpath string) error

func (ReferenceFileSystem) Root

func (s ReferenceFileSystem) Root() string

func (ReferenceFileSystem) Stat

func (s ReferenceFileSystem) Stat(filename string) (os.FileInfo, error)
func (s ReferenceFileSystem) Symlink(target, link string) error

func (ReferenceFileSystem) TempFile

func (s ReferenceFileSystem) TempFile(dir, prefix string) (billy.File, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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