server

package
v0.0.0-...-2873e01 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseMiddleware

func BaseMiddleware(isProduction bool, log *zap.Logger) []func(http.Handler) http.Handler

func Demux

func Demux(state uint32, r chi.Router) *demux

func LogRequest

func LogRequest(next http.Handler) http.Handler

LogRequest middleware logs request details

It uses logger from context, see contextLogger()

func LogResponse

func LogResponse(next http.Handler) http.Handler

LogResponse middleware logs response details

It uses logger from context, see contextLogger()

func New

func New(log *zap.Logger, envOpt options.EnvironmentOpt, httpOpt options.HttpServerOpt, waitForOpt options.WaitForOpt, searcherOpt options.SearcherOpt) *server

New initializes new HTTP server with special powers Server is started as early as possible and with a special request handler that demultiplexes request to one of the configured routers according to the server state.

Waiting state This is initial state that with some simple route handlers:

  • /version
  • /healthcheck
  • /healthcheck

Types

This section is empty.

Jump to

Keyboard shortcuts

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