MCPcopy Create free account
hub / github.com/danderson/netboot / Booter

Interface Booter

pixiecore/pixiecore.go:119–135  ·  view source on GitHub ↗

A Booter provides boot instructions and files for machines. Due to the stateless nature of various boot protocols, BootSpec() will be called multiple times in the course of a single boot attempt.

Source from the content-addressed store, hash-verified

117// will be called multiple times in the course of a single boot
118// attempt.
119type Booter interface {
120 // The given MAC address wants to know what it should
121 // boot. What should Pixiecore make it boot?
122 //
123 // Returning an error or a nil BootSpec will make Pixiecore ignore
124 // the client machine's request.
125 BootSpec(m Machine) (*Spec, error)
126 // Get the bytes corresponding to an ID given in Spec.
127 //
128 // Additionally returns the total number of bytes in the
129 // ReadCloser, or -1 if the size is unknown. Be warned, returning
130 // -1 will make the boot process orders of magnitude slower due to
131 // poor ipxe behavior.
132 ReadBootFile(id ID) (io.ReadCloser, int64, error)
133 // Write the given Reader to an ID given in Spec.
134 WriteBootFile(id ID, body io.Reader) error
135}
136
137// Firmware describes a kind of firmware attempting to boot.
138//

Callers 7

TestStaticBooterFunction · 0.65
TestAPIBooterFunction · 0.65
serveDHCPMethod · 0.65
handleIpxeMethod · 0.65
TestStaticBooterFunction · 0.65
TestAPIBooterFunction · 0.65
handleFileMethod · 0.65

Implementers 2

staticBooterpixiecore/booters.go
apibooterpixiecore/booters.go

Calls

no outgoing calls

Tested by

no test coverage detected