githubfs

package module
v0.0.0-...-5157c60 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2017 License: BSD-2-Clause Imports: 16 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const CommitMessage = "automatic commit from githubfs 🎆"
View Source
const FilePathSeparator = string(filepath.Separator)

Variables

View Source
var (
	ErrFileClosed        = errors.New("File is closed")
	ErrOutOfRange        = errors.New("Out of range")
	ErrTooLarge          = errors.New("Too large")
	ErrFileNotFound      = os.ErrNotExist
	ErrFileExists        = os.ErrExist
	ErrDestinationExists = os.ErrExist
)

Functions

func AddToMemDir

func AddToMemDir(dir *FileData, f *FileData)

func ChangeFileName

func ChangeFileName(f *FileData, newname string)

func NewGitHubFs

func NewGitHubFs(client *github.Client, user string, repo string, branch string) (afero.Fs, error)

func RemoveFromMemDir

func RemoveFromMemDir(dir *FileData, f *FileData)

func SetModTime

func SetModTime(f *FileData, mtime time.Time)

func SetMode

func SetMode(f *FileData, mode os.FileMode)

func String

func String(s string) *string

Types

type Dir

type Dir interface {
	Len() int
	Names() []string
	Files() []*FileData
	Add(*FileData)
	Remove(*FileData)
}

type DirMap

type DirMap map[string]*FileData

func (DirMap) Add

func (m DirMap) Add(f *FileData)

func (DirMap) Files

func (m DirMap) Files() (files []*FileData)

func (DirMap) Len

func (m DirMap) Len() int

func (DirMap) Names

func (m DirMap) Names() (names []string)

func (DirMap) Remove

func (m DirMap) Remove(f *FileData)

type File

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

func NewFileHandle

func NewFileHandle(data *FileData, fs *githubFs, entry github.TreeEntry) *File

func NewReadOnlyFileHandle

func NewReadOnlyFileHandle(data *FileData) *File

func (*File) Close

func (f *File) Close() error

func (File) Data

func (f File) Data() *FileData

func (*File) Info

func (f *File) Info() *FileInfo

func (*File) Name

func (f *File) Name() string

func (*File) Open

func (f *File) Open() error

func (*File) Read

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

func (*File) ReadAt

func (f *File) ReadAt(b []byte, off int64) (n int, err error)

func (*File) Readdir

func (f *File) Readdir(count int) (res []os.FileInfo, err error)

func (*File) Readdirnames

func (f *File) Readdirnames(n int) (names []string, err error)

func (*File) Seek

func (f *File) Seek(offset int64, whence int) (int64, error)

func (*File) Stat

func (f *File) Stat() (os.FileInfo, error)

func (*File) Sync

func (f *File) Sync() error

func (*File) Truncate

func (f *File) Truncate(size int64) error

func (*File) Write

func (f *File) Write(b []byte) (n int, err error)

func (*File) WriteAt

func (f *File) WriteAt(b []byte, off int64) (n int, err error)

func (*File) WriteString

func (f *File) WriteString(s string) (ret int, err error)

type FileData

type FileData struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func CreateDir

func CreateDir(name string) *FileData

func CreateFile

func CreateFile(name string) *FileData

func (*FileData) Name

func (d *FileData) Name() string

type FileInfo

type FileInfo struct {
	*FileData
}

func GetFileInfo

func GetFileInfo(f *FileData) *FileInfo

func (*FileInfo) IsDir

func (s *FileInfo) IsDir() bool

func (*FileInfo) ModTime

func (s *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (s *FileInfo) Mode() os.FileMode

func (*FileInfo) Name

func (s *FileInfo) Name() string

Implements os.FileInfo

func (*FileInfo) Size

func (s *FileInfo) Size() int64

func (*FileInfo) Sys

func (s *FileInfo) Sys() interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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