http

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServeMux

type ServeMux struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ServeMux is our HTTP request multiplexer with removable handlers.

func NewServeMux

func NewServeMux() *ServeMux

NewServeMux create a new HTTP request multiplexer.

func (*ServeMux) Handle

func (mux *ServeMux) Handle(pattern string, handler http.Handler)

Handle registers a handler for the given pattern.

func (*ServeMux) HandleFunc

func (mux *ServeMux) HandleFunc(pattern string, fn func(http.ResponseWriter, *http.Request))

HandleFunc registers a handler function for the given pattern.

func (*ServeMux) ServeHTTP

func (mux *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP serves a HTTP request.

func (*ServeMux) Unregister

func (mux *ServeMux) Unregister(pattern string) (http.Handler, bool)

Unregister unregister any handlers for the given pattern.

type Server

type Server struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Server is our HTTP server, with support for unregistering handlers.

func NewServer

func NewServer() *Server

NewServer creates a new server instance.

func (*Server) GetAddress

func (s *Server) GetAddress() string

GetAddress returns the current server HTTP endpoint/address.

func (*Server) GetMux

func (s *Server) GetMux() *ServeMux

GetMux returns the mux for this server.

func (*Server) Reconfigure

func (s *Server) Reconfigure(addr string) error

Reconfigure reconfigures the server.

func (*Server) Restart

func (s *Server) Restart(addr string) error

Restart restarts it on the given address.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP servers the given HTTP request.

func (*Server) Shutdown

func (s *Server) Shutdown(wait bool)

Shutdown shuts down the server gracefully.

func (*Server) Start

func (s *Server) Start(addr string) error

Start sets up the server to listen and serve on the given address.

func (*Server) Stop

func (s *Server) Stop()

Stop Close()'s the server immediately.

Jump to

Keyboard shortcuts

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