ihttp

package
v0.0.0-...-b1b25fa Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package ihttp implements an HTTP server for iPXE binaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(ctx context.Context, addr netip.AddrPort, h *http.Server) error

ListenAndServe is a patterned after http.ListenAndServe. It listens on the TCP network address srv.Addr and then calls ServeHTTP to handle requests on incoming connections.

ListenAndServe always returns a non-nil error. After Shutdown or Close, the returned error is http.ErrServerClosed.

func Serve

func Serve(_ context.Context, conn net.Listener, h *http.Server) error

Serve is patterned after http.Serve. It accepts incoming connections on the Listener conn and serves them using the Server h.

Serve always returns a non-nil error and closes conn. After Shutdown or Close, the returned error is http.ErrServerClosed.

Types

type Handler

type Handler struct {
	Log   logr.Logger
	Patch []byte
}

Handler is the struct that implements the http.Handler interface.

func (Handler) Handle

func (s Handler) Handle(w http.ResponseWriter, req *http.Request)

Handle handles GET and HEAD responses to HTTP requests. Serves embedded iPXE binaries.

Jump to

Keyboard shortcuts

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