server

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	*http.Server
	// contains filtered or unexported fields
}

Server provides an http.Server

func New

func New(listenAddr string, logger *slog.Logger, mux *chi.Mux) (*Server, error)

New creates and configures a server serving all application routes.

The server implements a graceful shutdown and utilizes zap.Logger for logging purposes.

func NewWithHTTPServer

func NewWithHTTPServer(srv *http.Server, logger *slog.Logger) (*Server, error)

NewWithHTTPServer creates and configures a server serving all application routes.

func (*Server) Start

func (srv *Server) Start()

Start runs ListenAndServe on the http.Server with graceful shutdown

Jump to

Keyboard shortcuts

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