Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContentContext ¶
type ContentContext struct { // Address of netbootd server LocalIP net.IP // Address of client RemoteIP net.IP // Base URL to the HTTP service (IP and port) - not API HttpBaseUrl *url.URL // Copy of Manifest Manifest *Manifest }
ContentContext is the template context available for static Content embedded in Manifests.
type HardwareAddr ¶
type HardwareAddr []byte
A HardwareAddr represents a physical hardware address.
func ParseMAC ¶
func ParseMAC(s string) (hw HardwareAddr, err error)
ParseMAC parses s as an IEEE 802 MAC-48, EUI-48, EUI-64, or a 20-octet IP over InfiniBand link-layer address using one of the following formats:
00:00:5e:00:53:01 02:00:5e:10:00:00:00:01 00:00:00:00:fe:80:00:00:00:00:00:00:02:00:5e:10:00:00:00:01 00-00-5e-00-53-01 02-00-5e-10-00-00-00-01 00-00-00-00-fe-80-00-00-00-00-00-00-02-00-5e-10-00-00-00-01 0000.5e00.5301 0200.5e10.0000.0001 0000.0000.fe80.0000.0000.0000.0200.5e10.0000.0001
func (HardwareAddr) MarshalText ¶
func (a HardwareAddr) MarshalText() ([]byte, error)
MarshalText implements encoding.TextMarshaler using the standard string representation of a HardwareAddr.
func (HardwareAddr) String ¶
func (a HardwareAddr) String() string
func (*HardwareAddr) UnmarshalText ¶
func (a *HardwareAddr) UnmarshalText(text []byte) error
UnmarshalText implements encoding.TextUnmarshaler.
type IPWithNet ¶
func (*IPWithNet) MarshalText ¶
MarshalText implements encoding.TextMarshaler using the standard CIDR representation of a IPNet.
func (*IPWithNet) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type Manifest ¶
type Manifest struct { ID string `yaml:"id"` IPv4 IPWithNet `yaml:"ipv4"` Hostname string `yaml:"hostname"` Domain string `yaml:"domain"` LeaseDuration time.Duration `yaml:"leaseDuration"` MAC []HardwareAddr DNS []net.IP Router []net.IP NTP []net.IP Ipxe bool BootFilename string `yaml:"bootFilename"` Mounts []Mount Suspended bool }
Manifest represents user-supplied per-host manifest information. go-yaml accepts completely lowercase version of keys but is not case-insensitive https://github.com/go-yaml/yaml/issues/123 some fields are forcefully mapped to camelCase instead of CamelCase and camelcase
func ManifestFromJson ¶
func ManifestFromYaml ¶
type Mount ¶
type Mount struct { // Path at which to select this mount. Path string // If Prefix is set to true, the Path is treated as a prefix. PathIsPrefix bool `yaml:"pathIsPrefix"` // The proxy destination used when handling requests. // Mutually exclusive with Content option. Proxy string // If PathIsPrefix is true and AppendSuffix is true, the suffix to Path Prefix will also be appended to Proxy Or LocalDir. // Otherwise, it will be many to one proxy. AppendSuffix bool `yaml:"appendSuffix"` // Provides content template (passed through template/text) to serve. // Mutually exclusive with Proxy option. Content string // Provides a path on the host to find the files. // So that LocalDir: /tftpboot path: /subdir and client requests: /subdir/file.x the path on the host // becomes /tfptboot/file.x LocalDir string `yaml:"localDir"` }
Mount represents a path exposed via TFTP and HTTP.