package gitfs
import "github.com/forensicanalysis/gitfs"
Example¶
Code:play
package main import ( "fmt" "io/fs" "github.com/forensicanalysis/gitfs" ) func main() { // init file system fsys, _ := gitfs.New("https://github.com/boltdb/bolt") // read root directory data, _ := fs.ReadFile(fsys, "README.md") // print files fmt.Println(string(data)[:4]) }
Output:
Bolt
Index ¶
- type GitEntry
- func (g *GitEntry) Info() (fs.FileInfo, error)
- func (g *GitEntry) IsDir() bool
- func (g *GitEntry) ModTime() time.Time
- func (g *GitEntry) Mode() fs.FileMode
- func (g *GitEntry) Name() string
- func (g *GitEntry) Size() int64
- func (g *GitEntry) Sys() interface{}
- func (g *GitEntry) Type() fs.FileMode
- type GitFS
- func New(url string) (*GitFS, error)
- func NewWithOptions(options *git.CloneOptions) (*GitFS, error)
- func (g *GitFS) Open(name string) (fs.File, error)
- func (g *GitFS) ReadDir(name string) (entries []fs.DirEntry, err error)
- func (g *GitFS) Stat(name string) (fs.FileInfo, error)
- type GitFile
- func (g *GitFile) Close() error
- func (g *GitFile) Read(bytes []byte) (int, error)
- func (g *GitFile) ReadDir(n int) ([]fs.DirEntry, error)
- func (g *GitFile) Stat() (fs.FileInfo, error)
- type PseudoDir
Examples ¶
Types ¶
type GitEntry ¶
type GitEntry struct {
// contains filtered or unexported fields
}
func (*GitEntry) Info ¶
func (*GitEntry) IsDir ¶
func (*GitEntry) ModTime ¶
func (*GitEntry) Mode ¶
func (*GitEntry) Name ¶
func (*GitEntry) Size ¶
func (*GitEntry) Sys ¶
func (g *GitEntry) Sys() interface{}
func (*GitEntry) Type ¶
type GitFS ¶
type GitFS struct {
FS billy.Filesystem
}
func New ¶
func NewWithOptions ¶
func (*GitFS) Open ¶
func (*GitFS) ReadDir ¶
func (*GitFS) Stat ¶
type GitFile ¶
type GitFile struct {
// contains filtered or unexported fields
}
func (*GitFile) Close ¶
func (*GitFile) Read ¶
func (*GitFile) ReadDir ¶
func (*GitFile) Stat ¶
type PseudoDir ¶
type PseudoDir struct {
// contains filtered or unexported fields
}
func (*PseudoDir) Close ¶
func (*PseudoDir) Read ¶
func (*PseudoDir) ReadDir ¶
func (*PseudoDir) Stat ¶
Source Files ¶
entry.go file.go fs.go pseudoroot.go
- Version
- v0.2.3 (latest)
- Published
- Feb 23, 2025
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 1 week ago –
Tools for package owners.