aboutsummaryrefslogtreecommitdiff
path: root/object/object.go
blob: 53fb0a582dff4e31e2fb92e42e3d4be0c4f73d26 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Package object provides Git object models and codecs.
package object

import (
	"errors"

	"codeberg.org/lindenii/furgit/objecttype"
)

var (
	// ErrInvalidObject indicates malformed serialized data.
	ErrInvalidObject = errors.New("object: invalid object encoding")
	// ErrNotFound indicates missing entries in in-memory lookups.
	ErrNotFound = errors.New("object: not found")
)

// Object is a Git object that can serialize itself.
type Object interface {
	ObjectType() objecttype.Type
	SerializeWithoutHeader() ([]byte, error)
	SerializeWithHeader() ([]byte, error)
}