Debian Codegraph @

storer.go

raw
1 package gitobj
2
3 import "io"
4
5 // storer implements a storage engine for reading, writing, and creating
6 // io.ReadWriters that can store information about loose objects
7 type storer interface {
8 // Open returns a handle on an existing object keyed by the given SHA.
9 // It returns an error if that file does not already exist.
10 Open(sha []byte) (f io.ReadCloser, err error)
11
12 // Store copies the data given in "r" to the unique object path given by
13 // "sha". It returns an error if that file already exists (acting as if
14 // the `os.O_EXCL` mode is given in a bitmask to os.Open).
15 Store(sha []byte, r io.Reader) (n int64, err error)
16 }