Files
podman/pkg/api/handlers/generic/ping.go
Brent Baude 54587335be [CI:DOCS]Binding overhauls
Add binding for networks and begin documentation for binding methods for godoc.  Also, add major functions to their own subpackages so reduce the amount of of method confusion.  So instead of: bindings.ListImages(), we now do a [bindings].images.List().

Also, the connection is passed to each binding method via a context to allow for future growth.

Lastly, add first set of tests.  There are a couple of things to work out for rootless tests yet.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-01-28 08:42:18 -06:00

28 lines
591 B
Go

package generic
import (
"fmt"
"net/http"
"github.com/containers/libpod/pkg/api/handlers"
)
func PingGET(w http.ResponseWriter, _ *http.Request) {
setHeaders(w)
fmt.Fprintln(w, "OK")
}
func PingHEAD(w http.ResponseWriter, _ *http.Request) {
setHeaders(w)
fmt.Fprintln(w, "")
}
func setHeaders(w http.ResponseWriter) {
w.Header().Set("API-Version", handlers.DefaultApiVersion)
w.Header().Set("BuildKit-Version", "")
w.Header().Set("Docker-Experimental", "true")
w.Header().Set("Cache-Control", "no-cache")
w.Header().Set("Pragma", "no-cache")
w.WriteHeader(http.StatusOK)
}