storage

package
v0.0.0-...-03f3354 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2015 License: GPL-3.0 Imports: 12 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL