Documentation
¶
Overview ¶
http.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPHandler ¶
NewHTTPHandler returns a new HTTP handler that routes incoming requests to the appropriate endpoints. It takes an `endpoints` parameter of type `endpoint.Endpoints` which contains the implementation of various endpoints. The handler is responsible for mapping the incoming HTTP requests to the corresponding endpoint functions. It returns an `http.Handler` that can be used to serve the HTTP requests.
func NewHTTPServer ¶
NewHTTPServer creates a new HTTP server that listens on the specified address and handles requests using the provided handler.
Parameters: - addr: The address to listen on (e.g., "localhost:8080"). - handler: The http.Handler to handle incoming requests.
Example usage:
NewHTTPServer("localhost:8080", myHandler)
Note: This function blocks indefinitely, so it should typically be called in a separate goroutine.
Types ¶
This section is empty.