httpd

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package httpd adapts the gouldian server to net/http

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(srv *µ.Server) http.Handler

Handler adapts the server to http.Handler. The context of the request is propagated to endpoints.

api := µ.NewServer(µ.WithCORS(...)).Mount( ... )
http.ListenAndServe(":8080", httpd.Handler(api))

func Serve

func Serve(endpoints ...µ.Routable) http.Handler

Serve builds http.Handler for sequence of endpoints

http.ListenAndServe(":8080", httpd.Serve( ... ))

func ServeAndCommit

func ServeAndCommit(commit func(), endpoints ...µ.Routable) http.Handler

ServeAndCommit builds http.Handler for sequence of endpoints. It executes commit function after each request.

http.ListenAndServe(":8080", httpd.ServeAndCommit(commit, ... ))

Types

This section is empty.

Jump to

Keyboard shortcuts

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