httpServer

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: BSD-3-Clause Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

Option is a function that sets optional parameters for the Server.

func WithTLSConfig

func WithTLSConfig(tlsConfig *tls.Config) Option

WithTLSConfig sets a TLS configuration for the HTTP server and creates a TLS listener.

type Options

type Options struct {
	// contains filtered or unexported fields
}

Options struct holds parameters that can be configure using functions with prefix With.

type Server

type Server struct {
	http.Server
}

Server wraps http.Server to provide methods for resenje.org/web/servers.Server interface.

func New

func New(handler http.Handler, opts ...Option) (s *Server)

New creates a new instance of Server.

func (*Server) ServeTCP added in v0.2.0

func (s *Server) ServeTCP(ln net.Listener) (err error)

ServeTCP executes http.Server.Serve method. If the provided listener is net.TCPListener, keep alive will be enabled. If server is configured with TLS, a tls.Listener will be created with provided listener.

Jump to

Keyboard shortcuts

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