func (d *shimDriver) Remove(req volumeplugin.Request) volumeplugin.Response { var res volumeplugin.Response v, err := d.d.Get(req.Name) if err != nil { res.Err = err.Error() return res } if err := d.d.Remove(v); err != nil { res.Err = err.Error() } return res }
func (d *shimDriver) Unmount(req volumeplugin.UnmountRequest) volumeplugin.Response { var res volumeplugin.Response v, err := d.d.Get(req.Name) if err != nil { res.Err = err.Error() return res } if err := v.Unmount(req.ID); err != nil { res.Err = err.Error() } return res }
func (d *shimDriver) Mount(req volumeplugin.Request) volumeplugin.Response { var res volumeplugin.Response v, err := d.d.Get(req.Name) if err != nil { res.Err = err.Error() return res } pth, err := v.Mount() if err != nil { res.Err = err.Error() } res.Mountpoint = pth return res }
func (d *shimDriver) Create(req volumeplugin.Request) volumeplugin.Response { var res volumeplugin.Response _, err := d.d.Create(req.Name, req.Options) if err != nil { res.Err = err.Error() } return res }
func (d *shimDriver) Get(req volumeplugin.Request) volumeplugin.Response { var res volumeplugin.Response v, err := d.d.Get(req.Name) if err != nil { res.Err = err.Error() return res } res.Volume = &volumeplugin.Volume{ Name: v.Name(), Mountpoint: v.Path(), } return res }
func (d *shimDriver) List(req volumeplugin.Request) volumeplugin.Response { var res volumeplugin.Response ls, err := d.d.List() if err != nil { res.Err = err.Error() return res } vols := make([]*volumeplugin.Volume, len(ls)) for _, v := range ls { vol := &volumeplugin.Volume{ Name: v.Name(), Mountpoint: v.Path(), } vols = append(vols, vol) } res.Volumes = vols return res }