pkg/localconfig/host.go

31 lines
411 B
Go
Raw Normal View History

2018-12-10 07:28:24 +00:00
package localconfig
import (
"io"
yaml "gopkg.in/yaml.v2"
)
type Host struct {
Name string
MACs []string
IPs []string
2018-12-10 10:52:14 +00:00
IPXE string
2018-12-10 07:28:24 +00:00
2018-12-10 10:52:14 +00:00
Kernel string
Initrd string
Versions map[string]string
Config string
2018-12-10 07:28:24 +00:00
}
func (h *Host) WriteHashDataTo(w io.Writer) error {
return yaml.NewEncoder(w).Encode(Host{
2018-12-10 10:52:14 +00:00
Kernel: h.Kernel,
Initrd: h.Initrd,
Versions: h.Versions,
Config: h.Config,
2018-12-10 07:28:24 +00:00
})
}