Documentation
¶
Index ¶
Constants ¶
const ( DefaultHTTPListener = ":8880" DefaultTFTPListener = ":69" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Boot ¶
Boot is an iPXE script, templatable with Vars, that will be used for each of the Devices. If Script is not empty, its contents will be used. Otherwise, the contents are loaded from ScriptPath.
type RenderConfig ¶
type RenderConfig struct {
Boot *Boot
Device *Device
// Vars is the merged Vars map. See [NewRenderConfig] for details.
Vars Vars
}
RenderConfig is what will be passed to text/template when a file is rendered.
func NewRenderConfig ¶
func NewRenderConfig(baseVars map[string]string, boot *Boot, device *Device) *RenderConfig
NewRenderConfig returns a RenderConfig containing the boot and device, as well as the merged Vars map. Values in device.Vars override values in boot.Vars, which override values in baseVars.
type Server ¶
type Server struct {
Boots []Boot
Vars map[string]string
StaticRoot string
HTTPListener string
TFTPListener string
}
Server is a pixie server configuration.
func (*Server) Listen ¶
Listen starts an HTTP server (for the API) and a TFTP server, and blocks until either of them exit.
func (*Server) NewRenderConfig ¶
func (s *Server) NewRenderConfig(mac string) (*RenderConfig, error)
NewRenderConfig will return a RenderConfig for the boot/device associated with the given MAC address.
func (*Server) RenderScript ¶
RenderScript will render the script associated with the provided MAC address using text/template. A RenderConfig is created and used when rendering the template.