gitgetter

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileTreeReader added in v0.2.0

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

FileTreeReader provides an API to read directory and it's files from Billy's filesystem.

func (FileTreeReader) ReadFile added in v0.2.0

func (r FileTreeReader) ReadFile(filename string) ([]byte, error)

ReadFile reads the file from file tree named by filename and returns the contents. A successful call returns err == nil, not err == EOF. Because ReadFile reads the whole file, it does not treat an EOF from Read as an error to be reported.

func (FileTreeReader) Walk added in v0.2.0

func (r FileTreeReader) Walk(walkFn walkFunc) error

Walk walks the file tree, calling walkFn for each file or directory in the tree, including root. All errors that arise visiting files and directories are filtered by walkFn. The files are walked in lexical order, which makes the output deterministic but means that for very large directories Walk can be inefficient. Walk does not follow symbolic links.

type Getter added in v0.2.0

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

func New added in v0.2.0

func New(l Logger) *Getter

func (*Getter) Get added in v0.2.0

func (g *Getter) Get(repourl string) (*FileTreeReader, error)

Get clones git repository into in-memory filesystem and returns FileTreeReader with repository source files. An URL can be any valid URL supported by official git client. In case a host is a known one (github.com, bitbucket.org, gitlab.com, gitea.com) then specifying protocol is optional.

Git references can be specified with a hash fragment at the end of the URL: `host.com/repository#refs/tags/1.0.0`

Subdirectories can be specified with a double-slash within path part of the URL. If a host is a known one, then directory will be resolved automatically after single slash, considering path consist of user and repository name only.

Examples: ``` http://unknownhost.com/user/repo//subdirectory github.com/user/repo/subdirectory ```

type Logger added in v0.2.0

type Logger interface {
	Debug(v ...interface{})
}

Jump to

Keyboard shortcuts

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