Documentation ¶
Index ¶
- Variables
- func BadRequest(w http.ResponseWriter, key string, value string, err error)
- func ContainerNotFound(w http.ResponseWriter, name string, err error)
- func ContainerNotRunning(w http.ResponseWriter, containerID string, err error)
- func CreateContainer(ctx context.Context, w http.ResponseWriter, runtime *libpod.Runtime, ...)
- func Error(w http.ResponseWriter, apiMessage string, code int, err error)
- func FilterMapToString(filters map[string][]string) (string, error)
- func GenerateFilterFuncsFromMap(r *libpod.Runtime, filters map[string][]string) ([]libpod.ContainerFilter, error)
- func GetImages(w http.ResponseWriter, r *http.Request) ([]*image.Image, error)
- func GetName(r *http.Request) string
- func ImageNotFound(w http.ResponseWriter, name string, err error)
- func InternalServerError(w http.ResponseWriter, err error)
- func IsLibpodRequest(r *http.Request) bool
- func KillContainer(w http.ResponseWriter, r *http.Request) (*libpod.Container, error)
- func PodNotFound(w http.ResponseWriter, name string, err error)
- func RemoveContainer(w http.ResponseWriter, r *http.Request, force, vols bool)
- func UnSupportedParameter(param string)
- func VolumeNotFound(w http.ResponseWriter, name string, err error)
- func WaitContainer(w http.ResponseWriter, r *http.Request) (int32, error)
- func WriteJSON(w http.ResponseWriter, code int, value interface{})
- func WriteResponse(w http.ResponseWriter, code int, value interface{})
- type ContainerCreateResponse
- type ErrorModel
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 ContainerNotFound ¶
func ContainerNotFound(w http.ResponseWriter, name string, err error)
func ContainerNotRunning ¶
func ContainerNotRunning(w http.ResponseWriter, containerID string, err error)
func CreateContainer ¶ added in v1.8.1
func CreateContainer(ctx context.Context, w http.ResponseWriter, runtime *libpod.Runtime, cc *createconfig.CreateConfig)
func Error ¶
func Error(w http.ResponseWriter, apiMessage string, 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 GenerateFilterFuncsFromMap ¶
func GenerateFilterFuncsFromMap(r *libpod.Runtime, filters map[string][]string) ([]libpod.ContainerFilter, error)
GenerateFilterFuncsFromMap is used to generate un-executed functions that can be used to filter containers. It is specifically designed for the RESTFUL API input.
func GetImages ¶
GetImages is a common function used to get images for libpod and other compatibility mechanisms
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 KillContainer ¶
func PodNotFound ¶
func PodNotFound(w http.ResponseWriter, name string, err error)
func RemoveContainer ¶
func RemoveContainer(w http.ResponseWriter, r *http.Request, force, vols bool)
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 WaitContainer ¶
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, code int, value interface{})
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 ¶
type ContainerCreateResponse ¶ added in v1.8.1
type ContainerCreateResponse struct { // ID of the container created ID string `json:"id"` // Warnings during container creation Warnings []string `json:"Warnings"` }
ContainerCreateResponse is the response struct for creating a container
type ErrorModel ¶
type ErrorModel struct { // API root cause formatted for automated parsing // example: API root cause Because string `json:"cause"` // human error message, formatted for a human to read // example: human error message Message string `json:"message"` // http response code ResponseCode int `json:"response"` }
func (ErrorModel) Cause ¶
func (e ErrorModel) Cause() error
func (ErrorModel) Code ¶
func (e ErrorModel) Code() int
func (ErrorModel) Error ¶
func (e ErrorModel) Error() string