server

package
v0.0.0-...-7dc7b4a Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2016 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FuncWithMiddleware

func FuncWithMiddleware(h http.HandlerFunc, mw ...Middleware) http.HandlerFunc

FuncWithMiddleware returns an HTTP Handler function which wraps a handler function h with middlewares mw.

func NewGitTransporter

func NewGitTransporter(conf *vcsstore.Config) git.GitTransporter

Types

type Handler

type Handler struct {
	Service        vcsstore.Service
	GitTransporter git.GitTransporter

	Log *log.Logger

	// Debug is whether to report internal error messages to HTTP clients.
	//
	// IMPORTANT NOTE: This should be set to false in publicly available
	// servers, as internal error messages may reveal sensitive information.
	Debug bool
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(svc vcsstore.Service, gitTrans git.GitTransporter, parent *mux.Router, mw ...Middleware) *Handler

NewHandler adds routes and handlers to an existing parent router (or creates one if parent is nil). Middleware is injected between mux and the handler functions (so you have access to gorilla/context for example)

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Middleware

type Middleware func(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)

Jump to

Keyboard shortcuts

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