gitgo: github.com/ChimeraCoder/gitgo Index | Files | Directories

package gitgo

import "github.com/ChimeraCoder/gitgo"

Index

Package Files

cat-file.go delta.go log.go object.go pack.go packobjecttype_string.go repository.go scanner.go verify-pack.go

Constants

const (
    OBJ_COMMIT packObjectType
    OBJ_TREE
    OBJ_BLOB
    OBJ_TAG

    OBJ_OFS_DELTA
    OBJ_REF_DELTA
)
const (
    RFC2822 = "Mon Jan 2 15:04:05 2006 -0700"
)

func CatFile Uses

func CatFile(name SHA) (io.Reader, error)

CatFile implements git cat-file for the command-line tool. Currently it supports only the -t fiag

func Log Uses

func Log(name SHA, basedir *os.File) ([]Commit, error)

Log is equivalent to `git log <SHA>`. If basedir is non-nil and points to a valid git respository, the command will be run using that repository.

func ScanLinesNoTrim Uses

func ScanLinesNoTrim(data []byte, atEOF bool) (advance int, token []byte, err error)

ScanLinesNoTrim is exactly like bufio.ScanLines, except it does not trim the newline

func ScanNullLines Uses

func ScanNullLines(data []byte, atEOF bool) (advance int, token []byte, err error)

ScanNullLines is like bufio.ScanLines, except it uses the null character as the delimiter instead of a newline

func VerifyPack Uses

func VerifyPack(pack io.ReadSeeker, idx io.Reader) ([]*packObject, error)

VerifyPack returns the pack objects contained in the packfile and corresponding index file.

type Blob Uses

type Blob struct {
    Contents []byte
    // contains filtered or unexported fields
}

A Blob compresses content from a file

func (Blob) Type Uses

func (b Blob) Type() string

type Commit Uses

type Commit struct {
    Name          SHA
    Tree          string
    Parents       []SHA
    Author        string
    AuthorDate    time.Time
    Committer     string
    CommitterDate time.Time
    Message       []byte
    // contains filtered or unexported fields
}

func (Commit) Type Uses

func (c Commit) Type() string

type GitObject Uses

type GitObject interface {
    Type() string
}

GitObject represents a commit, tree, or blob. Under the hood, these may be objects stored directly or through packfiles

func NewObject Uses

func NewObject(input SHA, basedir os.File) (obj GitObject, err error)

type Repository Uses

type Repository struct {
    Basedir os.File
    // contains filtered or unexported fields
}

func (*Repository) Object Uses

func (r *Repository) Object(input SHA) (obj GitObject, err error)

type SHA Uses

type SHA string

SHA represents the SHA-1 hash used by git

type Tree Uses

type Tree struct {
    Blobs []objectMeta
    Trees []objectMeta
    // contains filtered or unexported fields
}

func (Tree) Type Uses

func (t Tree) Type() string

Directories

PathSynopsis
gitgo

Package gitgo imports 13 packages (graph) and is imported by 1 packages. Updated 2017-10-12. Refresh now. Tools for package owners.