handler

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package handler defines common HTTP handlers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File string

File defines the path of a static file to be served by the server.

func (File) Handler

func (f File) Handler(w http.ResponseWriter, r *http.Request)

Handler will serve the file set on this handler.

type Redirect added in v0.4.0

type Redirect string

Redirect handler used to redirect a request.

func (Redirect) Handle added in v0.4.0

func (r Redirect) Handle(res http.ResponseWriter, req *http.Request)

Handle the request by redirecting to Redirect.

type Unauthorised added in v0.4.0

type Unauthorised struct {
	conversation.Error
}

The Unauthorised handler will return a status Forbidden.

func (Unauthorised) Handle added in v0.4.0

func (u Unauthorised) Handle(w http.ResponseWriter, _ *http.Request)

Handle the request by returning a status Forbidden.

Jump to

Keyboard shortcuts

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