httpsvr

package
v0.0.0-...-1316e39 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2025 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithHTTPServer

func WithHTTPServer() gontainer.Option

WithHTTPServer returns a factory for the HTTP server service.

Types

type Config

type Config struct {
	// ListenAddr is the HTTP server listening address.
	// Example: `127.0.0.1:8000`.
	ListenAddr string `env:"HTTP_LISTEN"`
}

Config is an HTTP server configuration.

type Server

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

Server is an HTTP server service.

func (*Server) Close

func (s *Server) Close() error

Close closes HTTP server.

func (*Server) GetMux

func (s *Server) GetMux() *http.ServeMux

GetMux returns the HTTP serve mux.

func (*Server) Start

func (s *Server) Start() error

Start serves HTTP in background. This function should be called manually when the app is ready to start. See the `services.app.WithAppEntryPoint()` factory for more details.

Jump to

Keyboard shortcuts

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