Versions in this module Expand all Collapse all v0 v0.6.1 Dec 1, 2026 v0.6.0 Dec 1, 2026 Changes in this version + const Blob + const Commit + const MaxHeaders + const MaxObjectBytes + const MaxTreeEntries + const Tag + const Tree + var ErrAlgo = errors.New("objects: unsupported hash algorithm") + var ErrCorrupt = packfile.ErrCorrupt + var ErrLimit = packfile.ErrLimit + var ErrNonCanonical = errors.New("objects: non-canonical encoding") + var ErrSize = errors.New("objects: hashed bytes differ from the declared size") + var ErrType = errors.New("objects: unknown object type") + func ObjectHeader(t Type, size int64) ([]byte, error) + type Algo uint8 + const SHA1 + func (a Algo) String() string + type CommitObject struct + Author Signature + Committer Signature + Headers []Header + Message string + Parents []ID + Tree ID + func DecodeCommit(data []byte) (*CommitObject, error) + func (c *CommitObject) Encode() ([]byte, error) + func (c *CommitObject) GPGSig() string + func (c *CommitObject) Header(key string) (string, bool) + type Entry struct + ID ID + Mode Mode + Name string + type Hasher struct + func NewHasher(a Algo, t Type, size int64) (*Hasher, error) + func (h *Hasher) Sum() (ID, error) + func (h *Hasher) Write(p []byte) (int, error) + type Header struct + Key string + Value string + type ID = packfile.ID + func ComputeHash(a Algo, t Type, data []byte) (ID, error) + type Mode uint32 + const ModeDeprecated + const ModeDir + const ModeEmpty + const ModeExecutable + const ModeRegular + const ModeSubmodule + const ModeSymlink + func (m Mode) Canonical() Mode + func (m Mode) IsDir() bool + func (m Mode) IsGitlink() bool + func (m Mode) IsRegular() bool + func (m Mode) IsSubmodule() bool + func (m Mode) IsSymlink() bool + func (m Mode) String() string + type Signature struct + Email string + Name string + TZ string + When int64 + func (s Signature) OffsetSeconds() int + func (s Signature) String() string + type TagObject struct + Message string + Name string + Signature string + Tagger *Signature + Target ID + TargetType Type + func DecodeTag(data []byte) (*TagObject, error) + func (t *TagObject) Encode() ([]byte, error) + type TreeObject struct + Entries []Entry + func DecodeTree(data []byte) (*TreeObject, error) + func (t *TreeObject) Encode() ([]byte, error) + type Type = packfile.Type