Documentation
¶
Index ¶
- type BranchSegmentNode
- type BranchesNode
- type CommitsNode
- type FileHandler
- type FileNode
- type ObjectTreeNode
- func (node *ObjectTreeNode) Getattr(_ context.Context, _ fs.FileHandle, out *fuse.AttrOut) syscall.Errno
- func (node *ObjectTreeNode) Lookup(ctx context.Context, name string, _ *fuse.EntryOut) (*fs.Inode, syscall.Errno)
- func (node *ObjectTreeNode) Readdir(_ context.Context) (fs.DirStream, syscall.Errno)
- type RootNode
- type TagSegmentNode
- type TagsNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BranchSegmentNode ¶
BranchSegmentNode is a node that represents a segment of a branch name. For example, if the branch name is "foo/bar/baz", then there will be three BranchSegmentNodes, one for "foo", one for "bar", and one for "baz".
func NewBranchSegmentNode ¶
func NewBranchSegmentNode(repository *git.Repository, branchPrefix string) *BranchSegmentNode
NewBranchSegmentNode creates a new BranchSegmentNode.
func (*BranchSegmentNode) Lookup ¶
func (node *BranchSegmentNode) Lookup(ctx context.Context, name string, _ *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Lookup returns the child node with the given name. If the name is a branch name, then a new ObjectTreeNode is returned. Otherwise, a new BranchSegmentNode is returned. It returns ENOENT if the name is not found.
type BranchesNode ¶
BranchesNode is a filesystem node that represents a list of branches. It is a directory that contains a list of branches. Each branch is a directory. If branch contains directory separator, it will be split into segments and each segment will be a nested directory. For example, if branch name is "foo/bar", it will be represented as "foo" directory with "bar" directory inside.
func NewBranchesNode ¶
func NewBranchesNode(repository *git.Repository) *BranchesNode
NewBranchesNode creates a new BranchesNode.
func (*BranchesNode) Lookup ¶
func (node *BranchesNode) Lookup(ctx context.Context, name string, _ *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Lookup returns a branch commit three node or a branch segment node. If branch name is "foo", it will return a branch commit tree node. If branch name is "foo/bar", it will return a branch segment node with name "bar". It returns ENOENT if the name is not found.
type CommitsNode ¶
CommitsNode is a filesystem node that represents a list of commits. It is a child of the root node. It is a directory. It contains a list of directories, each directory represents a commit.
func NewCommitsNode ¶
func NewCommitsNode(repository *git.Repository) *CommitsNode
NewCommitsNode creates a new CommitsNode.
type FileHandler ¶ added in v1.3.1
type FileHandler struct {
// contains filtered or unexported fields
}
FileHandler implements the fs.FileReader interface. It is used to read the file. It holds bytes.Reader to read the file at the given offset.
func NewFileHandler ¶ added in v1.3.1
func NewFileHandler(file *object.File, reader io.ReaderAt) *FileHandler
NewFileHandler creates a new file handler.
type FileNode ¶
FileNode is a file node.
func NewFileNode ¶
NewFileNode creates a new file node.
type ObjectTreeNode ¶
ObjectTreeNode is a node that represents a tree object in a git repository. It is used to represent the content of commit.
func NewObjectTreeNode ¶
func NewObjectTreeNode( repository *git.Repository, revision string, commit *object.Commit, tree *object.Tree, ) *ObjectTreeNode
NewObjectTreeNode creates a new ObjectTreeNode.
func NewObjectTreeNodeByRevision ¶
func NewObjectTreeNodeByRevision(repository *git.Repository, revision string) (*ObjectTreeNode, error)
NewObjectTreeNodeByRevision creates a new ObjectTreeNode by a revision name. The revision name can be a branch name, a tag name or a commit hash.
func (*ObjectTreeNode) Getattr ¶
func (node *ObjectTreeNode) Getattr(_ context.Context, _ fs.FileHandle, out *fuse.AttrOut) syscall.Errno
type RootNode ¶
RootNode is the root node of the filesystem. It contains the following subdirectories: - branches: list of branches - commits: list of commits - tags: list of tags
func NewRootNode ¶
func NewRootNode(repository *git.Repository) *RootNode
NewRootNode creates a new RootNode.
type TagSegmentNode ¶
TagSegmentNode is a node that represents a segment of a tag name. For example, if the tag name is "release/v1.0.0" then there will be two TagSegmentNodes, one for "release" and one for "v1.0.0".
func NewTagSegmentNode ¶
func NewTagSegmentNode(repository *git.Repository, tagPrefix string) *TagSegmentNode
NewTagSegmentNode creates a new TagSegmentNode.
func (*TagSegmentNode) Lookup ¶
func (node *TagSegmentNode) Lookup(ctx context.Context, name string, _ *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Lookup returns the child node with the given name. If the name is a tag name, then a new ObjectTreeNode is returned. Otherwise, a new TagSegmentNode is returned. It returns ENOENT if the name is not found.
type TagsNode ¶
TagsNode is a node that represents a git repository's tags. It is a directory that contains a directory for each tag. If tag contains directory separator, it will be split into segments and each segment will be a nested directory. For example, if tag name is "foo/bar", it will be represented as "foo" directory with "bar" directory inside.
func NewTagsNode ¶
func NewTagsNode(repository *git.Repository) *TagsNode
NewTagsNode creates a new TagsNode.
func (*TagsNode) Lookup ¶
func (node *TagsNode) Lookup(ctx context.Context, name string, _ *fuse.EntryOut) (*fs.Inode, syscall.Errno)
Lookup returns a tag commit tree node or a tag segment node. If tag name is "foo", it will return a tag commit tree node. If tag name is "foo/bar", it will return a tag segment node with name "bar". It returns ENOENT if the name is not found.