(remote, operation string)
| 334 | } |
| 335 | |
| 336 | func (c *genericLockClient) getClient(remote, operation string) lockClient { |
| 337 | info := lockClientInfo{ |
| 338 | remote: remote, |
| 339 | operation: operation, |
| 340 | } |
| 341 | if client := c.lclients[info]; client != nil { |
| 342 | return client |
| 343 | } |
| 344 | transfer := c.client.SSHTransfer(operation, remote) |
| 345 | var lclient lockClient |
| 346 | if transfer != nil { |
| 347 | lclient = &sshLockClient{transfer: transfer, Client: c.client} |
| 348 | } else { |
| 349 | lclient = &httpLockClient{Client: c.client} |
| 350 | } |
| 351 | c.lclients[info] = lclient |
| 352 | return lclient |
| 353 | } |
| 354 | |
| 355 | func (c *genericLockClient) Lock(remote string, lockReq *lockRequest) (*lockResponse, int, error) { |
| 356 | return c.getClient(remote, "upload").Lock(remote, lockReq) |
no test coverage detected