memgit

package
v0.0.0-...-1e4df44 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2014 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryGit

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

func New

func New() *MemoryGit

New returns an in-memory simple git repo

func (*MemoryGit) AddFile

func (mg *MemoryGit) AddFile(name string, data []byte) (path string)

AddFile adds a file to the repo. To pass git fsck, all the file names must be sorted.

func (*MemoryGit) Commit

func (mg *MemoryGit) Commit(msg string, commitTime int64) (treepath, commitpath string)

Commit commits all the added files to the repo with the specific message and time. Commit will automatically be called if you call HttpHandler().

func (*MemoryGit) HttpHandler

func (mg *MemoryGit) HttpHandler(prefix string, l *log.Logger) http.Handler

HttpHandler returns an http.Handler to serve the repo over http. It will automatically strip the prefix from r.URL.Path.

Jump to

Keyboard shortcuts

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