github.com/hoffie/larasync@v0.0.0-20151025221940-0384d2bddcef/repository/content/storage.go (about)

     1  package content
     2  
     3  import (
     4  	"io"
     5  )
     6  
     7  // Storage is the generic interface for implementations of
     8  // Backends which store blob data.
     9  type Storage interface {
    10  	// Get returns the file handle for the given contentID.
    11  	// If there is no data stored for the Id it should return a
    12  	// os.ErrNotExists error.
    13  	Get(contentID string) (io.ReadCloser, error)
    14  	// Set sets the data of the given contentID in the blob storage.
    15  	Set(contentID string, reader io.Reader) error
    16  	// Exists checks if the given entry is stored in the database.
    17  	Exists(contentID string) bool
    18  	// Delete removes the data with the given contentID from the store.
    19  	Delete(contentID string) error
    20  }