Documentation ¶
Index ¶
- Variables
- func BranchRef(name string) string
- func TagRef(name string) string
- type Blob
- type ByName
- type CRC32
- type Commit
- type Object
- type ObjectData
- type Pack
- type PackHeader
- type PackIndexEntry
- type PackIndexV2
- type PackIndexV2Header
- type PackedRefs
- type Ref
- type Refs
- type Repository
- func (r *Repository) Blob(id SHA1) (*Blob, error)
- func (r *Repository) Branches() []*Ref
- func (r *Repository) Commit(id SHA1) (*Commit, error)
- func (r *Repository) FindRef(name string) (*Ref, error)
- func (r *Repository) Head() (*Ref, error)
- func (r *Repository) NewBlob(data ObjectData) *Blob
- func (r *Repository) NewCommit(tree *Tree, parents []*Commit, author, committer *User, msg string) *Commit
- func (r *Repository) NewRef(name string, id SHA1) *Ref
- func (r *Repository) NewTag(name string, obj Object, tagger *User, msg string) *Tag
- func (r *Repository) NewTree() *Tree
- func (r *Repository) Object(id SHA1) (Object, error)
- func (r *Repository) Ref(name string) (*Ref, error)
- func (r *Repository) Resolve(obj Object) error
- func (r *Repository) Tag(id SHA1) (*Tag, error)
- func (r Repository) Tags() []*Ref
- func (r *Repository) Tree(id SHA1) (*Tree, error)
- type SHA1
- type SparseObject
- func (s *SparseObject) Blob() (*Blob, error)
- func (s *SparseObject) Commit() (*Commit, error)
- func (s *SparseObject) Resolve() (Object, error)
- func (s *SparseObject) SHA1() SHA1
- func (s *SparseObject) Tag() (*Tag, error)
- func (s *SparseObject) Tree() (*Tree, error)
- func (s *SparseObject) Write() error
- type Tag
- type Tree
- func (t *Tree) Add(path string, obj Object, mode TreeEntryMode) error
- func (t *Tree) Find(path string) (*SparseObject, TreeEntryMode, error)
- func (t *Tree) FindBlob(path string) (*Blob, TreeEntryMode, error)
- func (t *Tree) FindTree(path string) (*Tree, TreeEntryMode, error)
- func (t *Tree) Parse(data []byte) error
- func (t *Tree) Remove(path string) error
- func (t *Tree) Resolve() error
- func (t *Tree) Resolved() bool
- func (t *Tree) SHA1() SHA1
- func (t *Tree) Write() error
- type TreeEntry
- type TreeEntryMode
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrChecksum = errors.New("Incorrect checksum") ErrObjectNotFound = errors.New("Object not found") )
View Source
var ErrInvalidDelta = errors.New("invalid delta")
View Source
var ErrPrefixNotMatch = errors.New("Prefix not match")
View Source
var ErrTypeMismatch = errors.New("Error type mismatch")
View Source
var ErrUnknownFormat = errors.New("Unknown format")
Functions ¶
Types ¶
type Commit ¶
type ObjectData ¶
type Pack ¶
type Pack struct { PackHeader // contains filtered or unexported fields }
type PackHeader ¶
type PackIndexEntry ¶
type PackIndexV2 ¶
type PackIndexV2 struct { PackIndexV2Header Objects []SHA1 CRC32s []CRC32 Offsets []uint32 LargeOffsets []uint64 PackFileHash SHA1 PackIndexHash SHA1 }
func OpenPackIndex ¶
func OpenPackIndex(path string) (*PackIndexV2, error)
func (*PackIndexV2) Entry ¶
func (idx *PackIndexV2) Entry(id SHA1) *PackIndexEntry
type PackIndexV2Header ¶
type PackedRefs ¶
func (*PackedRefs) Parse ¶
func (p *PackedRefs) Parse() error
func (*PackedRefs) Ref ¶
func (p *PackedRefs) Ref(name string) *Ref
func (*PackedRefs) Refs ¶
func (p *PackedRefs) Refs(prefix string) []*Ref
type Ref ¶
type Repository ¶
func Open ¶
func Open(path string) (*Repository, error)
func (*Repository) Branches ¶
func (r *Repository) Branches() []*Ref
func (*Repository) FindRef ¶
func (r *Repository) FindRef(name string) (*Ref, error)
FindRef searches ref that has given name. Both full name and omitted name are accepted like git command.
func (*Repository) Head ¶
func (r *Repository) Head() (*Ref, error)
func (*Repository) NewBlob ¶
func (r *Repository) NewBlob(data ObjectData) *Blob
func (*Repository) NewTree ¶
func (r *Repository) NewTree() *Tree
func (*Repository) Ref ¶
func (r *Repository) Ref(name string) (*Ref, error)
Ref loads ref that has given name. It only accepts full name. If it's not certain about what kind of refs, FindRef maybe helpful.
func (*Repository) Resolve ¶
func (r *Repository) Resolve(obj Object) error
func (Repository) Tags ¶
func (r Repository) Tags() []*Ref
type SparseObject ¶
type SparseObject struct {
// contains filtered or unexported fields
}
func (*SparseObject) Blob ¶
func (s *SparseObject) Blob() (*Blob, error)
func (*SparseObject) Commit ¶
func (s *SparseObject) Commit() (*Commit, error)
func (*SparseObject) Resolve ¶
func (s *SparseObject) Resolve() (Object, error)
func (*SparseObject) SHA1 ¶
func (s *SparseObject) SHA1() SHA1
func (*SparseObject) Tag ¶
func (s *SparseObject) Tag() (*Tag, error)
func (*SparseObject) Tree ¶
func (s *SparseObject) Tree() (*Tree, error)
func (*SparseObject) Write ¶
func (s *SparseObject) Write() error
type Tag ¶
type Tree ¶
type Tree struct { Entries []*TreeEntry // contains filtered or unexported fields }
func (*Tree) Find ¶
func (t *Tree) Find(path string) (*SparseObject, TreeEntryMode, error)
type TreeEntry ¶
type TreeEntry struct { Mode TreeEntryMode Name string Object *SparseObject }
type TreeEntryMode ¶
type TreeEntryMode uint32
const ( ModeTree TreeEntryMode = 0040000 ModeFile TreeEntryMode = 0100644 ModeFileEx TreeEntryMode = 0100755 ModeSymlink TreeEntryMode = 0120000 )
func (TreeEntryMode) String ¶
func (m TreeEntryMode) String() string
Click to show internal directories.
Click to hide internal directories.