···11// Package objectstore provides interfaces for object storage backends.
22//
33+// Object stores only respond to object-ID queries in terms of headers (type
44+// and size), raw bytes, and streaming payloads, but they do not parse commits,
55+// trees, blobs, or tags into typed values. Turning stored objects into typed
66+// objects is the job of [codeberg.org/lindenii/furgit/object/fetch].
77+//
88+// This package also does not define a unified writing-store interface.
99+// Backends have very different write models: writing one loose object is
1010+// natural, while writing one object into a packfile backend is wasteful.
1111+// A variety of writing interfaces may be added later.
1212+//
313// Concrete implementations generally inherit the contract documented by the
414// interfaces they satisfy. Implementation docs focus on additional guarantees
515// and implementation-specific behavior.
+2-6
object/store/errors.go
···33import "errors"
4455// ErrObjectNotFound indicates that an object does not exist in a backend.
66-// This error MUST only be used in situations where the object store has
77-// no specified object ID, but no other unexpected conditions were
88-// encountered. In particular, it is not suitable for situations where one
99-// object references another (such as a tree referencing a blob) but
1010-// the latter does not exist; these situations should use a separate
1111-// error (TODO).
66+// This error must only be produced by object stores, when it has no
77+// specified object ID, but no other unexpected conditions were encountered.
128var ErrObjectNotFound = errors.New("objectstore: object not found")
-9
object/store/writing.go
···11-package objectstore
22-33-// There is currently no writing-store interface because different
44-// object store backends have very different models for writing.
55-// For example, a loose object store can trivially write single loose
66-// objects, but writing individual objects to a packfile store would
77-// be extremely wasteful.
88-//
99-// At some time, we will have writing-store interfaces.