Documentation ¶
Overview ¶
Package ipxe implements the iPXE tftp and http server.
Index ¶
- func ListenAndServeHTTP(ctx context.Context, addr netaddr.IPPort, h *http.Server) error
- func ListenAndServeTFTP(ctx context.Context, addr netaddr.IPPort, s *tftp.Server) error
- func ServeHTTP(_ context.Context, conn net.Listener, h *http.Server) error
- func ServeTFTP(_ context.Context, conn net.PacketConn, s *tftp.Server) error
- type Config
- type HTTP
- type HandleHTTP
- type HandleTFTP
- type TFTP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListenAndServeHTTP ¶
ListenAndServeHTTP 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.
ListenAndServeHTTP always returns a non-nil error. After Shutdown or Close, the returned error is http.ErrServerClosed.
func ListenAndServeTFTP ¶
ListenAndServeTFTP sets up the listener on the given address and serves TFTP requests.
Types ¶
type Config ¶
type Config struct { // TFTP holds the details for the TFTP server. TFTP TFTP // HTTP holds the details for the HTTP server. HTTP HTTP // Log is the logger to use. Log logr.Logger }
Config holds the details for running the iPXE service.
type HTTP ¶
type HTTP struct { // Addr is the address:port to listen on. Addr netaddr.IPPort // Timeout is the timeout for serving HTTP files. Timeout time.Duration }
HTTP is the configuration for the HTTP server.
type HandleHTTP ¶
HandleHTTP is the struct that implements the http.Handler interface.
func (HandleHTTP) Handler ¶
func (s HandleHTTP) Handler(w http.ResponseWriter, req *http.Request)
Handler handles responses to HTTP requests.
type HandleTFTP ¶
HandleTFTP is the struct that implements the TFTP read and write function handlers.
func (HandleTFTP) ReadHandler ¶
func (t HandleTFTP) ReadHandler(filename string, rf io.ReaderFrom) error
ReadHandler handlers TFTP GET requests.
func (HandleTFTP) WriteHandler ¶
func (t HandleTFTP) WriteHandler(filename string, wt io.WriterTo) error
WriteHandler handles TFTP PUT requests. It will always return an error. This library does not support PUT.