Documentation ¶
Overview ¶
Package httpsync implements methods for requesting and serving files via CAFS
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FileHandler ¶
type FileHandler struct {
// contains filtered or unexported fields
}
Struct FileHandler implements the http.Handler interface and serves a file over HTTP. The protocol used matches with function SyncFrom. Create using the New... functions.
func NewFileHandlerFromFile ¶
func NewFileHandlerFromFile(file cafs.File, perm shuffle.Permutation) *FileHandler
Function NewFileHandlerFromFile creates a FileHandler that serves chunks of a File.
func NewFileHandlerFromSyncInfo ¶
func NewFileHandlerFromSyncInfo(syncinfo *remotesync.SyncInfo, storage cafs.FileStorage) *FileHandler
Function NewFileHandlerFromSyncInfo creates a FileHandler that serves chunks as specified in a FileInfo. It doesn't necessarily require all of the chunks to be present and will block waiting for a missing chunk to become available. As a specialty, a FileHander created using this function needs not be disposed.
func (*FileHandler) Dispose ¶
func (handler *FileHandler) Dispose()
It is the owner's responsibility to correctly dispose of FileHandler instances.
func (*FileHandler) ServeHTTP ¶
func (handler *FileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*FileHandler) WithPrinter ¶
func (handler *FileHandler) WithPrinter(printer cafs.Printer) *FileHandler
Sets the FileHandler's log Printer.