Documentation ¶
Index ¶
- Variables
- type BlobStore
- type CombinedStore
- func (c *CombinedStore) AppendBlobContent(b *models.Blob, reader io.Reader) (*models.Blob, int64, error)
- func (c *CombinedStore) DeleteBlobContent(blob *models.Blob) error
- func (c *CombinedStore) InsertBlobContent(b *models.Blob, offset int64, buf io.Reader) (*models.Blob, int64, error)
- func (c *CombinedStore) RetrieveBlobContent(b *models.Blob, w io.Writer) (int64, error)
- func (c *CombinedStore) RetrieveURLForBlobContent(b *models.Blob, r *mux.Router) (string, error)
- func (c *CombinedStore) WriteBlobContent(b *models.Blob, in io.Reader) (*models.Blob, int64, error)
- type ContentStore
- type EnumerableContentStore
- type EstimatableContentStore
- type MetadataStore
- type SynchronizationStore
Constants ¶
This section is empty.
Variables ¶
View Source
var BlobContentConfigError = errors.New("bad store configuration")
View Source
var BlobContentNotFoundError = errors.New("blob content missing")
View Source
var BlobMetadataError = errors.New("blob metadata issue")
View Source
var MethodNotSupportedError = errors.New("method not supported")
View Source
var NoMatchingBlobsError = errors.New("no matching blobs")
Functions ¶
This section is empty.
Types ¶
type BlobStore ¶
type BlobStore interface { // If false, this blob store doesn't contain the given blob, ContainsBlob(*models.Blob) (bool, error) // Removes the content associated with a blob. // If the content cannot be deleted, return an error and leave the // blob's content intact. Under no other circumstances should we // return an error. DeleteBlobContent(*models.Blob) error // Writes content associated with a blob // Updates metadata at the end. WriteBlobContent(*models.Blob, io.Reader) (*models.Blob, int64, error) // Writes content to the end of a blob AppendBlobContent(*models.Blob, io.Reader) (*models.Blob, int64, error) // Adds content at an arbitrary position within the file InsertBlobContent(*models.Blob, int64, io.Reader) (*models.Blob, int64, error) // Retrieves a URL to access the blob's content RetrieveURLForBlobContent(*models.Blob, *mux.Router) (string, error) // Retrieves a blob's content RetrieveBlobContent(*models.Blob, io.Writer) (int64, error) }
type CombinedStore ¶
type CombinedStore struct {
// contains filtered or unexported fields
}
CombinedStore takes a content store and metadata store and updates one after another. It complies the with the BlobStore interface
func CreateCombinedStore ¶
func CreateCombinedStore(metadataStore MetadataStore, contentStore ContentStore) *CombinedStore
CreateCombinedStore combines a metadataStore and a contentStore together.
func (*CombinedStore) AppendBlobContent ¶
func (*CombinedStore) DeleteBlobContent ¶
func (c *CombinedStore) DeleteBlobContent(blob *models.Blob) error
DeleteBlobContent removes a file's content and metadata from Repositron
func (*CombinedStore) InsertBlobContent ¶
func (*CombinedStore) RetrieveBlobContent ¶
func (*CombinedStore) RetrieveURLForBlobContent ¶
type ContentStore ¶
type ContentStore interface { ContainsBlob(*models.Blob) (bool, error) // Removes the content associated with a blob DeleteBlobContent(*models.Blob) error // WriteBlobContent replaces or creates content associated with a record. // i.e. if the content doesn't exist, it's created, // if it does exist, it's overwritten by the new content. // The Size field of the models.Blob argument should be ignored // The size returned should be the size of what was written using // the io.Reader. WriteBlobContent(*models.Blob, io.Reader) (*models.Blob, error) // Writes content to the end of a blob AppendBlobContent(*models.Blob, io.Reader) (*models.Blob, error) // Adds content at an arbitrary position within the file InsertBlobContent(*models.Blob, int64, io.Reader) (*models.Blob, error) // Retrieves a URL to access the blob's content RetrieveURLForBlobContent(*models.Blob, *mux.Router) (string, error) // Retrieves a blob's content RetrieveBlobContent(*models.Blob, io.Writer) (int64, error) }
ContentStore combines a separate MetadataStore and a BlobStore into something useful.
type EnumerableContentStore ¶
type EnumerableContentStore interface { ContentStore // RetrieveAllBlobs retrieves details of all Blobs in this ContentStore, // starts writing it into a channel. Blocks until all elements are wrtten // to the output channel. RetrieveAllBlobs(out chan *models.Blob) error }
type EstimatableContentStore ¶
type EstimatableContentStore interface { ContentStore // EstimateSizeOfManagedContent returns a size estimate of the // amount of stuff managed in this contentStore. EstimateSizeOfManagedContent() (int64, error) }
type MetadataStore ¶
type MetadataStore interface { // StoreBlobRecord commit WIP metadata to the database, returns a new Blob StoreBlobRecord(blob *models.Blob) (*models.Blob, error) // FinalizeBlobRecord stores the final file size, FinalizeBlobRecord(blob *models.Blob) (*models.Blob, error) // EstimateSizeOfManagedContent returns an overall size estimate for the // amount of stuff stored in the database. EstimateSizeOfManagedContent() (int64, error) DeleteBlobById(id int64) error RetrieveBlobById(id int64) (*models.Blob, error) GetBlobIdsMatchingChecksum(checksum string) ([]int64, error) GetBlobIdsMatchingName(name string) ([]int64, error) GetBlobIdsMatchingBucket(name string) ([]int64, error) // Retrieves each distinct bucket name. GetAllBuckets() ([]string, error) Close() error }
Click to show internal directories.
Click to hide internal directories.