githubfs

package
v0.0.0-...-abfce65 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrBadStatus

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

func (ErrBadStatus) Error

func (e ErrBadStatus) Error() string

type FS

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

Given a GitHub repository and access token, this filesystem will use the GitHub API to expose a read-write filesystem of the repository contents. Its root will contain all branches as directories.

func New

func New(owner, repoName, accessToken string) *FS

func (*FS) Chmod

func (g *FS) Chmod(name string, mode fs.FileMode) error

func (*FS) Chown

func (g *FS) Chown(name string, uid, gid int) error

func (*FS) Chtimes

func (g *FS) Chtimes(name string, atime time.Time, mtime time.Time) error

func (*FS) Create

func (g *FS) Create(name string) (fs.File, error)

func (*FS) Mkdir

func (g *FS) Mkdir(name string, perm fs.FileMode) error

func (*FS) MkdirAll

func (g *FS) MkdirAll(path string, perm fs.FileMode) error

func (*FS) Open

func (g *FS) Open(name string) (fs.File, error)

func (*FS) OpenFile

func (g *FS) OpenFile(name string, flag int, perm fs.FileMode) (fs.File, error)

func (*FS) Remove

func (g *FS) Remove(name string) error

func (*FS) RemoveAll

func (g *FS) RemoveAll(path string) error

func (*FS) Rename

func (g *FS) Rename(oldname, newname string) error

func (*FS) Stat

func (g *FS) Stat(name string) (fs.FileInfo, error)

type Tree

type Tree struct {
	Expired bool `json:"-"`

	Sha       string     `json:"sha"`
	URL       string     `json:"url"`
	Items     []TreeItem `json:"tree"` // TODO: use map[Path]TreeItem instead?
	Truncated bool       `json:"truncated"`
}

type TreeItem

type TreeItem struct {
	Path string `json:"path"`
	Mode string `json:"mode"`
	Type string `json:"type"`
	Size int64  `json:"size"`
	Sha  string `json:"sha"`
	URL  string `json:"url"`
}

Jump to

Keyboard shortcuts

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