file

package
v3.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2017 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package file implements a file server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

Error is a structure to hold the context to serve error files.

func NewError

func NewError(share string) (Error, error)

NewError returns a new file.Error.

func (Error) ServeError

func (context Error) ServeError(writer http.ResponseWriter,
	code int) (servedContent bool)

ServeError serves the error file corresponding with the given status code.

func (Error) ServeMovedPermanently

func (context Error) ServeMovedPermanently(writer http.ResponseWriter,
	location string)

ServeMovedPermanently serves "Moved Permanently" status.

type File

type File struct {
	// contains filtered or unexported fields
}

File is a structure to keep the context of the file server.

func New

func New(share string, fileError Error) File

New returns a new file server.

func (File) ServeHTTP

func (file File) ServeHTTP(writer http.ResponseWriter, request *http.Request)

ServeHTTP serves files via HTTP.

Jump to

Keyboard shortcuts

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