• Stars
    star
    1,604
  • Rank 27,986 (Top 0.6 %)
  • Language
    Go
  • License
    BSD 3-Clause "New...
  • Created about 11 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Package gorilla/handlers is a collection of useful middleware for Go HTTP services & web applications 🛃

gorilla/handlers

Testing Codecov GoDoc Sourcegraph

Package handlers is a collection of handlers (aka "HTTP middleware") for use with Go's net/http package (or any framework supporting http.Handler), including:

Other handlers are documented on the Gorilla website.

Example

A simple example using handlers.LoggingHandler and handlers.CompressHandler:

import (
    "net/http"
    "github.com/gorilla/handlers"
)

func main() {
    r := http.NewServeMux()

    // Only log requests to our admin dashboard to stdout
    r.Handle("/admin", handlers.LoggingHandler(os.Stdout, http.HandlerFunc(ShowAdminDashboard)))
    r.HandleFunc("/", ShowIndex)

    // Wrap our server with our gzip handler to gzip compress all responses.
    http.ListenAndServe(":8000", handlers.CompressHandler(r))
}

License

BSD licensed. See the included LICENSE file for details.

More Repositories

1

websocket

Package gorilla/websocket is a fast, well-tested and widely used WebSocket implementation for Go.
Go
20,778
star
2

mux

Package gorilla/mux is a powerful HTTP router and URL matcher for building Go web servers with 🦍
Go
19,888
star
3

sessions

Package gorilla/sessions provides cookie and filesystem sessions and infrastructure for custom session backends.
Go
2,694
star
4

schema

Package gorilla/schema fills a struct with form values.
Go
1,276
star
5

csrf

Package gorilla/csrf provides Cross Site Request Forgery (CSRF) prevention middleware for Go web applications & services 🔒
Go
976
star
6

feeds

Package gorilla/feeds is a golang rss/atom generator library
Go
703
star
7

securecookie

Package gorilla/securecookie encodes and decodes authenticated and optionally encrypted cookie values for Go web applications.
Go
652
star
8

rpc

Package gorilla/rpc is a golang foundation for RPC over HTTP services.
Go
560
star
9

context

Package gorilla/context is a golang registry for global request variables.
Go
429
star
10

http

Package gorilla/http is an alternative HTTP client implementation for Go.
Go
263
star
11

pat

Package gorilla/pat is a pretty simple HTTP router for Go.
Go
141
star
12

css

Package gorilla/css is a CSS3 tokenizer.
Go
83
star
13

muxy

Package gorilla/muxy takes gorilla/mux to the next level
Go
74
star
14

gorilla.github.io

Gorilla web toolkit's website.
HTML
58
star
15

reverse

Package gorilla/reverse is a set of utilities to create request routers.
Go
51
star
16

i18n

Package gorilla/i18n groups packages related to internationalization
Go
49
star
17

template

A fork of the standard template packages.
Go
45
star
18

.github

The .github repository for the @gorilla organization.
9
star