Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidOID = errors.New("OID is not valid")
View Source
var ErrObjectNotExist = errors.New("Object does not exist")
Functions ¶
Types ¶
type LocalStorage ¶
type LocalStorage struct { // The root path for storing LFS objects. Root string }
LocalStorage is a LFS storage backend on local file system.
func (*LocalStorage) Storage ¶
func (s *LocalStorage) Storage() Storage
func (*LocalStorage) Upload ¶
func (s *LocalStorage) Upload(oid OID, rc io.ReadCloser) (int64, error)
type Storage ¶
type Storage string
Storage is the storage type of an LFS object.
const (
StorageLocal Storage = "local"
)
type Storager ¶
type Storager interface { // Storage returns the name of the storage backend. Storage() Storage // Upload reads content from the io.ReadCloser and uploads as given oid. // The reader is closed once upload is finished. ErrInvalidOID is returned // if the given oid is not valid. Upload(oid OID, rc io.ReadCloser) (int64, error) // Download streams content of given oid to the io.Writer. It is caller's // responsibility the close the writer when needed. ErrObjectNotExist is // returned if the given oid does not exist. Download(oid OID, w io.Writer) error }
Storager is an storage backend for uploading and downloading LFS objects.
Click to show internal directories.
Click to hide internal directories.