func getContainerInfoRequest(body io.ReadCloser) (*info.ContainerInfoRequest, error) {
	query := info.DefaultContainerInfoRequest()
	decoder := json.NewDecoder(body)
	err := decoder.Decode(&query)
	if err != nil && err != io.EOF {
		return nil, fmt.Errorf("unable to decode the json value: %s", err)
	}

	return &query, nil
}
示例#2
0
文件: container.go 项目: missmayo/cfs
func containerInfo() (*v1.ContainerInfo, error) {
	infoReq := v1.DefaultContainerInfoRequest()
	return cmgr.GetContainerInfo(DefaultContainerName, &infoReq)
}