Documentation
¶
Overview ¶
Package objectid provides Git object IDs and object-ID hash algorithms.
Index ¶
- Variables
- func Compare(left, right ObjectID) int
- type Algorithm
- func (algo Algorithm) EmptyTree() ObjectID
- func (algo Algorithm) HexLen() int
- func (algo Algorithm) New() (hash.Hash, error)
- func (algo Algorithm) PackHashID() uint32
- func (algo Algorithm) SignatureHeaderName() string
- func (algo Algorithm) Size() int
- func (algo Algorithm) String() string
- func (algo Algorithm) Sum(data []byte) ObjectID
- func (algo Algorithm) Zero() ObjectID
- type ObjectID
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidAlgorithm indicates an unsupported object ID algorithm. ErrInvalidAlgorithm = errors.New("objectid: invalid algorithm") // ErrInvalidObjectID indicates malformed object ID data. ErrInvalidObjectID = errors.New("objectid: invalid object id") )
Functions ¶
Types ¶
type Algorithm ¶
type Algorithm uint8
Algorithm identifies the hash algorithm used for Git object IDs.
func ParseAlgorithm ¶
ParseAlgorithm parses a canonical algorithm name (e.g. "sha1", "sha256").
func ParseSignatureHeaderName ¶ added in v0.1.148
ParseSignatureHeaderName parses one canonical signature header name such as "gpgsig" or "gpgsig-sha256".
func SupportedAlgorithms ¶
func SupportedAlgorithms() []Algorithm
SupportedAlgorithms returns all object ID algorithms supported by furgit. Do not mutate.
func (Algorithm) EmptyTree ¶ added in v0.1.115
EmptyTree returns the object ID of an empty tree ("tree 0\x00") for this algorithm.
func (Algorithm) PackHashID ¶
PackHashID returns the Git pack/rev hash-id encoding for this algorithm.
Unknown algorithms return 0.
func (Algorithm) SignatureHeaderName ¶ added in v0.1.148
SignatureHeaderName returns the signature header name for this algorithm.
type ObjectID ¶
type ObjectID struct {
// contains filtered or unexported fields
}
ObjectID represents a Git object ID.
Source Files
¶
- algorithm.go
- algorithm_details.go
- algorithm_emptytree.go
- algorithm_hexlen.go
- algorithm_new.go
- algorithm_packhashid.go
- algorithm_parse.go
- algorithm_signatureheadername.go
- algorithm_size.go
- algorithm_string.go
- algorithm_sum.go
- algorithm_supported.go
- algorithm_tables.go
- algorithm_zero.go
- doc.go
- errors.go
- max_size.go
- objectid.go
- objectid_algorithm.go
- objectid_byte.go
- objectid_compare.go
- objectid_frombytes.go
- objectid_parse.go
- objectid_string.go
- signatureheadername_parse.go