Documentation ¶
Overview ¶
Package storage deals with files on the disk or whatever storage. It defines the Storage interface. It has methods for getting contents of a file, headers of a file and methods for removing files. Since every cache zone has its own storage it is possible to have different storage implementations running at the same time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage interface { // Returns a io.ReadCloser that will read from the `start` // of an object with ObjectId `id` to the `end`. Get(vh *config.VirtualHost, id ObjectID, start, end uint64) (io.ReadCloser, error) // Returns a io.ReadCloser that will read the whole file GetFullFile(vh *config.VirtualHost, id ObjectID) (io.ReadCloser, error) // Returns all headers for this object Headers(vh *config.VirtualHost, id ObjectID) (http.Header, error) // Discard an object from the storage Discard(id ObjectID) error // Discard an index of an Object from the storage DiscardIndex(index ObjectIndex) error }
A unit of Storage
func NewStorage ¶
func NewStorage(config CacheZoneSection, cm cache.CacheManager, up upstream.Upstream) Storage
Click to show internal directories.
Click to hide internal directories.