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)
type Middleware ¶
type Middleware func(rw http.ResponseWriter, r *http.Request, next http.HandlerFunc)
Click to show internal directories.
Click to hide internal directories.