(qh blobcache.Handle, requires blobcache.ActionSet)
| 317 | } |
| 318 | |
| 319 | func (sys *System) resolveQueue(qh blobcache.Handle, requires blobcache.ActionSet) (queue, blobcache.ActionSet, error) { |
| 320 | sys.mu.RLock() |
| 321 | defer sys.mu.RUnlock() |
| 322 | oid, rights := sys.handles.Resolve(qh) |
| 323 | if rights == 0 { |
| 324 | return queue{}, 0, blobcache.ErrInvalidHandle{Handle: qh} |
| 325 | } |
| 326 | if rights&requires < requires { |
| 327 | return queue{}, 0, blobcache.ErrPermission{ |
| 328 | Handle: qh, |
| 329 | Rights: rights, |
| 330 | Requires: requires, |
| 331 | } |
| 332 | } |
| 333 | q, exists := sys.queues[oid] |
| 334 | if !exists { |
| 335 | return queue{}, 0, blobcache.ErrInvalidHandle{Handle: qh} |
| 336 | } |
| 337 | return q, rights, nil |
| 338 | } |
| 339 | |
| 340 | // Share creates a new handle from x and applies mask. |
| 341 | func (sys *System) Share(x blobcache.Handle, mask blobcache.ActionSet) (blobcache.Handle, error) { |
no test coverage detected