Skip to content

nserv (nice server) Go package provides a variation of standard http.Server enhanced with graceful exit, throttling and zero-downtime restarts.

License

BSD-3-Clause, Unknown licenses found

Licenses found

BSD-3-Clause
LICENSE
Unknown
LICENSE-server-std
Notifications You must be signed in to change notification settings

kornel661/nserv

Repository files navigation

nserv

nserv (nice server) Go package provides a variation of standard http.Server enhanced with graceful exit, throttling and zero downtime restarts. Throttling makes it easier to build a DOS-attack-resistant server and graceful exit feature makes it easy to write a stoppable server with proper clean-up (e.g., closing database connections). Zero downtime restarts feature enables you to perform updates to the server without interrupting active clients. Nserv has been inspired by the manners package.

The package is in its early stages of development (in the sense that hasn't been tested extensively yet). API of the v0 version might change without warning, v0 should be considered as an unstable/development version.

See gopkg.in on versioning scheme.

For up-to-date changelog and features list see README.

Features

  • Full functionality of the standard http.Server.
  • Limiting number of simultaneous connections. The limit can be dynamically changed while the server is running.
  • Graceful exit.
  • Zero downtime restarts (version v0). You can stop running server and hand off responsibility of serving new clients to a different program (e.g., an updated version of the server). All without interrupting active clients.

Usage

go get -u gopkg.in/kornel661/nserv.v0

or

import "gopkg.in/kornel661/nserv.v0"

Replace v0 by the version you need, see package import site and gopkg.in for import path convention.

Versions

  • Bleeding-edge development version (github.com/kornel661/nserv) GoDoc GoWalker
  • Development version (v0) GoDoc GoWalker GoCover
  • Initial version with stable API (v1) GoDoc GoWalker GoCover

Goals

  • This package is intended as a light extension of Go's standard http server implementation.
  • Performance is important but not by overcomplicating the code.

Changelog

  • 2014.11.16 (version v0): Initial implementation of zero downtime restarts.
  • 2014.08.18 (version v1): Created version v1 - its API should be stable, though it isn't well-tested yet. Methods & fields can be added to the Server struct.
  • 2014.08.16 (version v0): Testing & bug hunting season opened.

About

nserv (nice server) Go package provides a variation of standard http.Server enhanced with graceful exit, throttling and zero-downtime restarts.

Resources

License

BSD-3-Clause, Unknown licenses found

Licenses found

BSD-3-Clause
LICENSE
Unknown
LICENSE-server-std

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages