git

package
v0.0.0-...-b6721d7 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	OBJ_COMMIT    = 1
	OBJ_TREE      = 2
	OBJ_BLOB      = 3
	OBJ_TAG       = 4
	OBJ_OFS_DELTA = 6
	OBJ_REF_DELTA = 7
)

Variables

This section is empty.

Functions

func ObjectToBytes

func ObjectToBytes(o Object) []byte

func PatchDelta

func PatchDelta(src, delta []byte) []byte

func WriteObject

func WriteObject(o Object, dir string) (err error)

func WritePackfile

func WritePackfile(writer io.Writer, p *Packfile) (err error)

Types

type Blob

type Blob struct {
	Content []byte
}

func (*Blob) Bytes

func (o *Blob) Bytes() []byte

func (*Blob) Hash

func (o *Blob) Hash() []byte

func (*Blob) New

func (o *Blob) New() Object

func (*Blob) SetBytes

func (o *Blob) SetBytes(b []byte) (err error)

func (*Blob) String

func (o *Blob) String() string

func (*Blob) Type

func (o *Blob) Type() string

type Commit

type Commit struct {
	Content   []byte
	Tree      Hash
	Parents   []Hash
	Author    string
	Committer string
	Message   string
}

func (*Commit) Bytes

func (o *Commit) Bytes() []byte

func (*Commit) Hash

func (o *Commit) Hash() []byte

func (*Commit) New

func (o *Commit) New() Object

func (*Commit) SetBytes

func (o *Commit) SetBytes(b []byte) (err error)

func (*Commit) String

func (o *Commit) String() string

func (*Commit) Type

func (o *Commit) Type() string

type Delta

type Delta struct {
	Hash  []byte
	Delta []byte
}

type Hash

type Hash []byte

func (Hash) String

func (h Hash) String() string

type Object

type Object interface {
	Hash() []byte
	Bytes() []byte
	SetBytes([]byte) error
	New() Object
	Type() string
}

func DecodeObject

func DecodeObject(b []byte) (o Object)

type Packfile

type Packfile struct {
	Version  uint32
	Objects  []Object
	Checksum []byte
	Deltas   []Delta
	// contains filtered or unexported fields
}

func NewPackfile

func NewPackfile(objects []Object) *Packfile

func ReadPackfile

func ReadPackfile(r io.Reader) (*Packfile, error)

func (*Packfile) ObjectByHash

func (r *Packfile) ObjectByHash(hash []byte) Object

func (*Packfile) ObjectByOffset

func (r *Packfile) ObjectByOffset(offset int) Object

func (*Packfile) PutObject

func (r *Packfile) PutObject(o Object)

type Tag

type Tag struct {
	Content []byte
}

func (*Tag) Bytes

func (o *Tag) Bytes() []byte

func (*Tag) Hash

func (o *Tag) Hash() []byte

func (*Tag) New

func (o *Tag) New() Object

func (*Tag) SetBytes

func (o *Tag) SetBytes(b []byte) (err error)

func (*Tag) String

func (o *Tag) String() string

func (*Tag) Type

func (o *Tag) Type() string

type Tree

type Tree struct {
	Content []byte
	Entries []treeEntry
}

func (*Tree) Bytes

func (o *Tree) Bytes() []byte

func (*Tree) Hash

func (o *Tree) Hash() []byte

func (*Tree) New

func (o *Tree) New() Object

func (*Tree) SetBytes

func (o *Tree) SetBytes(b []byte) (err error)

func (*Tree) String

func (o *Tree) String() string

func (*Tree) Type

func (o *Tree) Type() string

Jump to

Keyboard shortcuts

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