server

package
v0.0.0-...-d7c4e6e Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2019 License: GPL-3.0 Imports: 14 Imported by: 1

Documentation

Overview

Package server is used to serve blocked files via http

Current version: experimental

Index

Constants

This section is empty.

Variables

View Source
var (
	// This key is used for authentication with the server
	SharedKey = ""
)

Functions

func AuthorizeRequest

func AuthorizeRequest(method string, u *url.URL, h http.Header) bool

AuthorizeRequest - Will check the request authorization

func BlockAndRespond

func BlockAndRespond(w http.ResponseWriter, content io.Reader)

Handle the uploaded data.

func CopyHandler

func CopyHandler(u *url.URL, h http.Header, _ interface{}) (int, http.Header, *blocks.BlockedFile, error)

CopyHandler - The REST endpoint for deleting a BlockedFile

func DeleteHandler

func DeleteHandler(u *url.URL, h http.Header, _ interface{}) (int, http.Header, interface{}, error)

DeleteHandler - The REST endpoint for deleting a BlockedFile

func GetHello

func GetHello(u *url.URL, h http.Header, _ interface{}) (int, http.Header, string, error)

func HandleErrorWithResponse

func HandleErrorWithResponse(w http.ResponseWriter, error error)

func SetupAuthenticationKey

func SetupAuthenticationKey()

SetupAuthenticationKey - This deals with setting an auth key for the service

func Start

func Start()

Start a HTTP listener

Types

type FileDownloadHandler

type FileDownloadHandler struct {
}

func NewFileDownloadHandler

func NewFileDownloadHandler() FileDownloadHandler

func (FileDownloadHandler) ServeHTTP

func (handler FileDownloadHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type PostMultipartUploadHandler

type PostMultipartUploadHandler struct{}

PostMultipartUploadHandler handles POST operations

func NewPostMultipartUploadHandler

func NewPostMultipartUploadHandler() PostMultipartUploadHandler

func (PostMultipartUploadHandler) ServeHTTP

func (handler PostMultipartUploadHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type RawUploadHandler

type RawUploadHandler struct {
}

RawUploadHandler handles PUT operations

func NewRawUploadHandler

func NewRawUploadHandler() RawUploadHandler

func (RawUploadHandler) ServeHTTP

func (handler RawUploadHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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