gitfs

package module
v0.0.0-...-7c62259 Latest Latest
Warning

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

Go to latest
Published: May 26, 2014 License: MIT Imports: 7 Imported by: 1

README

GitFS

This lets you present a Git repository as a http.FileSystem to let the http package take care of the HTTP for you.

Dependencies

This uses git2go which uses libgit2. This means you need a compatible version of libgit2 installed and accessible on your system. At some point libgit2 will have a static version, which will make this simpler.

Usage

GoDoc

The constructors let you do more or less work depending on how much information you have. You can pass in a tree, a reference or simply the name.

The tree will be used as the root of the filesystem.

Documentation

Overview

Package gitfs implements a http.FileSystem which is backed by a Git repository.

More specifically, the object returned is tied to a particular tree, which it will present to the http library as an approximation to a real filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromReference

func NewFromReference(ref *git.Reference) (http.FileSystem, error)

NewFromReference creates a new http.FileSystem from a given reference. The reference must peel to a tree, which will then be exposed as the root of the filesystem

func NewFromReferenceName

func NewFromReferenceName(repo *git.Repository, branch string) (http.FileSystem, error)

NewFromReferenceName creates a new FileSystem from a reference (specified by name) in the given repository. The reference must peel to a tree, which will then be exposed as the root of the filesystem.

func NewFromTree

func NewFromTree(tree *git.Tree) http.FileSystem

NewFromTree creates a new http.FileSystem from a given tree. The tree will be exposed as the root of the filesystem.

Types

This section is empty.

Jump to

Keyboard shortcuts

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