/
booter.go
31 lines (25 loc) · 909 Bytes
/
booter.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2017-2019 the u-root Authors. All rights reserved
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package systembooter
import "log"
// Booter is an interface that defines custom boot types. Implementations can be
// like network boot, local boot, etc. Boolean debugEnabled can be used to turning on/off
// the Booter debugging log.
type Booter interface {
Boot(debugEnabled bool) error
TypeName() string
}
// NullBooter is a booter that does nothing. It is used when no other booter
// has been found.
type NullBooter struct{}
// TypeName returns the name of the booter type
func (nb *NullBooter) TypeName() string {
return "null"
}
// Boot will run the boot procedure. In the case of this NullBooter it will do
// nothing
func (nb *NullBooter) Boot(debugEnabled bool) error {
log.Printf("Null booter does nothing")
return nil
}