Kick streamlines configuration of a robust, hardened, production-ready
Go web server. Its core is based on
net/http and standard library
packages, and it integrates proven, high-quality community Go packages
for commonly-needed additional features.
Through the use of the
Builders type, it provides some flexibility
pluggability in the choice of third-party packages used to
deliver those extra features, but it is not the goal of this package
to be fully customizable - it is opinionated and as much as possible,
provides an out-of-the-box encoding of best practices.
The tests require a valid TLS certificate for localhost. The recommended approach is to use mkcert to create a local Certificate Authority and generate a locally-trusted certificate for localhost.
The following enviroment variables should be set:
KICK_TEST_LOCALHOST_CERTshould point to the localhost certificate file.
KICK_TEST_LOCALHOST_KEYshould point to the localhost certificate key file.
Additionally, to use Go modules with Go 1.11+:
Then run the tests:
$ go test ./... $ go test ./... -cover $ go test ./... -race
Kick automatically builds a robust, DOS-hardened web server based on proven, established and widely used Go packages:
github.com/gorilla/sessionsfor sessions with
github.com/boj/redistore(?) as backing store
github.com/gorilla/handlersfor panic recovery, CORS, canonical host, content-type validation, method override, trust proxy headers
github.com/julienschmidt/httprouterfor route multiplexing and static file serving
github.com/sirupsen/logrusfor structured logging
github.com/gorilla/schemafor decoding form values to structs, and
github.com/mna/httpparmsfor streamlined API with validation
github.com/sony/gobreakerfor the circuit breaker
golang.org/x/crypto/acme/autocertfor production TLS certificate
github.com/FiloSottile/mkcertfor localhost/development TLS certificate
github.com/throttled/throttledfor session-based rate-limiting
github.com/juju/ratelimitfor absolute endpoint rate-limiting
github.com/NYTimes/gziphandlerfor gzip compression
github.com/go-sql-driver/mysqlfor mysql DB support
github.com/jmoiron/sqlxfor added SQL and struct support
github.com/kelseyhightower/envconfigfor configuration, overridable via flags