示例#1
0
func NewHTTPBooter(listenAddr net.TCPAddr, ldlinux []byte,
	ds datasource.DataSource, webPort int) (*HTTPBooter, error) {
	bootMessageVersionedTemplate := strings.Replace(bootMessageTemplate, "$VERSION", ds.Version().Version, -1)
	booter := &HTTPBooter{
		listenAddr:          listenAddr,
		ldlinux:             ldlinux,
		datasource:          ds,
		webPort:             webPort,
		bootMessageTemplate: bootMessageVersionedTemplate,
	}
	return booter, nil
}
示例#2
0
func newDHCPHandler(settings *DHCPSetting, datasource datasource.DataSource) (*DHCPHandler, error) {
	h := &DHCPHandler{
		settings:    settings,
		datasource:  datasource,
		bootMessage: fmt.Sprintf("Blacksmith (%s)", datasource.Version().Version),
	}
	return h, nil
}