mirror of
https://github.com/containers/podman.git
synced 2025-06-11 18:28:41 +08:00

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>
28 lines
591 B
Go
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)
|
|
}
|