Documentation ¶
Index ¶
- Variables
- func BadRequest(w http.ResponseWriter, key string, value string, err error)
- func CompatPull(ctx context.Context, w http.ResponseWriter, runtime *libpod.Runtime, ...)
- func ContainerNotFound(w http.ResponseWriter, name string, err error)
- func ContainerNotRunning(w http.ResponseWriter, containerID string, err error)
- func Error(w http.ResponseWriter, code int, err error)
- func FilterMapToString(filters map[string][]string) (string, error)
- func GetDecoder(r *http.Request) *schema.Decoder
- func GetImage(r *http.Request, name string) (*libimage.Image, error)
- func GetName(r *http.Request) string
- func GetVar(r *http.Request, k string) string
- func ImageNotFound(w http.ResponseWriter, name string, err error)
- func InternalServerError(w http.ResponseWriter, err error)
- func IsLibpodRequest(r *http.Request) bool
- func IsRegistryReference(name string) error
- func MarshalErrorJSON(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func MarshalErrorJSONIsEmpty(ptr unsafe.Pointer) bool
- func MarshalErrorSliceJSON(ptr unsafe.Pointer, stream *jsoniter.Stream)
- func MarshalErrorSliceJSONIsEmpty(ptr unsafe.Pointer) bool
- func NetworkNotFound(w http.ResponseWriter, name string, err error)
- func NormalizeToDockerHub(r *http.Request, nameOrID string) (string, error)
- func PSTitles(output string) []string
- func ParseStorageReference(name string) (types.ImageReference, error)
- func PodNotFound(w http.ResponseWriter, name string, err error)
- func PossiblyEnforceDockerHub(r *http.Request, sys *types.SystemContext)
- func SecretNotFound(w http.ResponseWriter, nameOrID string, err error)
- func SessionNotFound(w http.ResponseWriter, name string, err error)
- func SupportedVersion(r *http.Request, condition string) (semver.Version, error)
- func UnSupportedParameter(param string)
- func VolumeNotFound(w http.ResponseWriter, name string, err error)
- func WaitContainerDocker(w http.ResponseWriter, r *http.Request)
- func WaitContainerLibpod(w http.ResponseWriter, r *http.Request)
- func WriteJSON(w http.ResponseWriter, code int, value interface{})
- func WriteResponse(w http.ResponseWriter, code int, value interface{})
Constants ¶
This section is empty.
Variables ¶
var (
ErrLinkNotSupport = errors.New("link is not supported")
)
Functions ¶
func BadRequest ¶
func BadRequest(w http.ResponseWriter, key string, value string, err error)
func CompatPull ¶
func CompatPull(ctx context.Context, w http.ResponseWriter, runtime *libpod.Runtime, reference string, pullPolicy config.PullPolicy, pullOptions *libimage.PullOptions)
func ContainerNotFound ¶
func ContainerNotFound(w http.ResponseWriter, name string, err error)
func ContainerNotRunning ¶
func ContainerNotRunning(w http.ResponseWriter, containerID string, err error)
func Error ¶
func Error(w http.ResponseWriter, code int, err error)
Error formats an API response to an error
apiMessage and code must match the container API, and are sent to client err is logged on the system running the podman service
func ImageNotFound ¶
func ImageNotFound(w http.ResponseWriter, name string, err error)
func InternalServerError ¶
func InternalServerError(w http.ResponseWriter, err error)
func IsLibpodRequest ¶
IsLibpodRequest returns true if the request related to a libpod endpoint (e.g., /v2/libpod/...).
func IsRegistryReference ¶
IsRegistryReference checks if the specified name points to the "docker://" transport. If it points to no supported transport, we'll assume a non-transport reference pointing to an image (e.g., "fedora:latest").
func MarshalErrorJSON ¶
MarshalErrorJSON writes error to stream as string
func MarshalErrorJSONIsEmpty ¶
func MarshalErrorSliceJSON ¶
MarshalErrorSliceJSON writes []error to stream as []string JSON blob
func NetworkNotFound ¶
func NetworkNotFound(w http.ResponseWriter, name string, err error)
func NormalizeToDockerHub ¶
NormalizeToDockerHub normalizes the specified nameOrID to Docker Hub if the request is for the compat API and if containers.conf set the specific mode. If nameOrID is a (short) ID for a local image, the full ID will be returned.
func PSTitles ¶
PSTitles merges CAPS headers from ps output. All PS headers are single words, except for CAPS. Function compines CAP Headers into single field separated by a space.
func ParseStorageReference ¶
func ParseStorageReference(name string) (types.ImageReference, error)
ParseStorageReference parses the specified image name to a `types.ImageReference` and enforces it to refer to a containers-storage-transport reference.
func PodNotFound ¶
func PodNotFound(w http.ResponseWriter, name string, err error)
func PossiblyEnforceDockerHub ¶
func PossiblyEnforceDockerHub(r *http.Request, sys *types.SystemContext)
PossiblyEnforceDockerHub sets fields in the system context to enforce resolving short names to Docker Hub if the request is for the compat API and if containers.conf set the specific mode.
func SecretNotFound ¶
func SecretNotFound(w http.ResponseWriter, nameOrID string, err error)
func SessionNotFound ¶
func SessionNotFound(w http.ResponseWriter, name string, err error)
func SupportedVersion ¶
SupportedVersion validates that the version provided by client is included in the given condition https://github.com/blang/semver#ranges provides the details for writing conditions If a version is not given in URL path, ErrVersionNotGiven is returned
func UnSupportedParameter ¶
func UnSupportedParameter(param string)
UnsupportedParameter logs a given param by its string name as not supported.
func VolumeNotFound ¶
func VolumeNotFound(w http.ResponseWriter, name string, err error)
func WaitContainerDocker ¶
func WaitContainerDocker(w http.ResponseWriter, r *http.Request)
func WaitContainerLibpod ¶
func WaitContainerLibpod(w http.ResponseWriter, r *http.Request)
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, code int, value interface{})
WriteJSON writes an interface value encoded as JSON to w
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, code int, value interface{})
WriteResponse encodes the given value as JSON or string and renders it for http client
Types ¶
This section is empty.