Documentation ¶
Overview ¶
Package server contains a HTTP server for serving the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements an HTTP server. It is set up as a http.Handler. Example:
srv := server.New(...) httpSrv := &http.Server{ Addr: ":8080", Handler: srv, } httpSrv.ListenAndServe()
func New ¶
func New(options ...ServerOption) *Server
New creates and initializes a new server using the given options.
type ServerOption ¶
type ServerOption func(*Server)
ServerOption specifies a signature for configuring the server.
func WithLogger ¶
func WithLogger(logger log.Logger) ServerOption
WithLogger allows to configure the logger being used. By default, the server will not log anything.
Click to show internal directories.
Click to hide internal directories.