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