(req dto.ContainerFileBatchDeleteReq)
| 1242 | } |
| 1243 | |
| 1244 | func (u *ContainerService) DeleteContainerFile(req dto.ContainerFileBatchDeleteReq) error { |
| 1245 | for _, item := range req.Paths { |
| 1246 | if strings.TrimSpace(item) == "/" { |
| 1247 | return buserr.New("ErrPathNotDelete") |
| 1248 | } |
| 1249 | } |
| 1250 | cli, err := docker.NewDockerClient() |
| 1251 | if err != nil { |
| 1252 | return err |
| 1253 | } |
| 1254 | defer cli.Close() |
| 1255 | |
| 1256 | command := []string{"rm", "-rf", "--"} |
| 1257 | command = append(command, req.Paths...) |
| 1258 | _, err = runContainerCommand(cli, req.ContainerID, command) |
| 1259 | return err |
| 1260 | } |
| 1261 | |
| 1262 | func (u *ContainerService) UploadContainerFile(req dto.ContainerFileReq, fileName string, fileSize int64, file io.Reader) error { |
| 1263 | if len(req.Path) == 0 { |
nothing calls this directly
no test coverage detected