http

package
v0.29.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package http implements an HTTP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorWriter added in v0.6.0

func ErrorWriter() runtime.ErrorHandlerFunc

ErrorWriter returns runtime.ErrorHandlerFunc to configure error handling.

Types

type Server

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

A Server defines configuration for running an HTTP server.

func NewServer

func NewServer(port uint16) *Server

NewServer returns http server with port.

func NewServerWithListener added in v0.7.0

func NewServerWithListener(listener net.Listener) *Server

NewServerWithListener returns http server with listener.

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the server address.

func (*Server) BuildServer added in v0.2.0

func (s *Server) BuildServer(tlsConfig *tls.Config) error

BuildServer init http server.

func (*Server) Close

func (s *Server) Close() error

Close closes the server.

func (*Server) IsPresent added in v0.27.0

func (s *Server) IsPresent() bool

func (*Server) RegistryDesc

func (s *Server) RegistryDesc(services ...transport.Service)

RegistryDesc in http server.

func (*Server) Router

func (s *Server) Router() chi.Router

Router returns http router.

func (*Server) Serve

func (s *Server) Serve() error

Serve starts serving incoming connections.

func (*Server) UseMiddleware added in v0.7.0

func (s *Server) UseMiddleware(middlewares ...func(http.Handler) http.Handler)

UseMiddleware appends a middleware handler to the Mux middleware stack.

Jump to

Keyboard shortcuts

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