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

Function api

pixiecore/api-example/main.go:42–58  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

40}
41
42func api(w http.ResponseWriter, r *http.Request) {
43 log.Printf("Serving boot config for %s", filepath.Base(r.URL.Path))
44 resp := struct {
45 K string `json:"kernel"`
46 I []string `json:"initrd"`
47 }{
48 K: "http://tinycorelinux.net/7.x/x86/release/distribution_files/vmlinuz64",
49 I: []string{
50 "http://tinycorelinux.net/7.x/x86/release/distribution_files/rootfs.gz",
51 "http://tinycorelinux.net/7.x/x86/release/distribution_files/modules64.gz",
52 },
53 }
54
55 if err := json.NewEncoder(w).Encode(&resp); err != nil {
56 panic(err)
57 }
58}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected