http

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Adapt

func Adapt(h http.Handler, adapters ...Adapter) http.Handler

Adapt applies the given adapters

func NewClient

func NewClient() mantra.Service

NewClient returns a new HTTP client

Types

type Adapter

type Adapter func(http.Handler) http.Handler

Adapter enables http middlewares

func BasicAuthentication

func BasicAuthentication(username, password, realm string) Adapter

BasicAuthentication adds basic HTTP authentication

func Cache

func Cache() Adapter

Cache adds cache-control headers to the response

func CloudflareAuthentication

func CloudflareAuthentication(authDomain, policyAUD string) Adapter

CloudflareAuthentication verifies cloudflare authentication tokens

func Header(key, value string) Adapter

Header adds a given header to the response

func Logging

func Logging(l *log.Logger) Adapter

Logging logs the request basic informations

func PProf

func PProf() Adapter

PProf adds pprof handlers

func Timing

func Timing(l *log.Logger) Adapter

Timing adds request timing information

func TurbolinksRedirect

func TurbolinksRedirect(store sessions.Store, sessionName string, location string) Adapter

TurbolinksRedirect handles turbolinks redirections

type RoutesFunc

type RoutesFunc func(*mux.Router)

RoutesFunc is a function defining HTTP routes

type Server

type Server interface {
	mantra.Service

	URL() string
	Serve()
}

Server is an HTTP server

func NewServer

func NewServer(routes RoutesFunc) Server

NewServer returns a supervised HTTP server

Jump to

Keyboard shortcuts

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