MCPcopy Create free account
hub / github.com/danderson/netboot / MakeAPIBootConfiguration

Function MakeAPIBootConfiguration

pixiecore/boot_configuration.go:65–82  ·  view source on GitHub ↗

MakeAPIBootConfiguration creates a new APIBootConfiguration initialized with provided values

(url string, timeout time.Duration, preference uint8, usePreference bool,
	dnsServerAddresses []net.IP)

Source from the content-addressed store, hash-verified

63
64// MakeAPIBootConfiguration creates a new APIBootConfiguration initialized with provided values
65func MakeAPIBootConfiguration(url string, timeout time.Duration, preference uint8, usePreference bool,
66 dnsServerAddresses []net.IP) *APIBootConfiguration {
67 if !strings.HasSuffix(url, "/") {
68 url += "/"
69 }
70 ret := &APIBootConfiguration{
71 Client: &http.Client{Timeout: timeout},
72 URLPrefix: url + "v1",
73 UsePreference: usePreference,
74 }
75 if usePreference {
76 ret.Preference = make([]byte, 1)
77 ret.Preference[0] = preference
78 }
79 ret.RecursiveDNS = dnsServerAddresses
80
81 return ret
82}
83
84// GetBootURL returns Boot File URL, see RFC 5970
85func (bc *APIBootConfiguration) GetBootURL(id []byte, clientArchType uint16) ([]byte, error) {

Callers 1

ipv6apicmd.goFile · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected