Create creates a new volume on the remote
(ctx context.Context, peer blobcache.NodeID, vspec blobcache.VolumeSpec)
| 61 | |
| 62 | // Create creates a new volume on the remote |
| 63 | func (ps *PeerSystem) CreateVolume(ctx context.Context, peer blobcache.NodeID, vspec blobcache.VolumeSpec) (*Volume, error) { |
| 64 | return withEndpoint(ctx, ps.locator, peer, func(ep blobcache.Endpoint) (*Volume, error) { |
| 65 | vol, err := ps.inner.CreateVolume(ctx, ep, vspec) |
| 66 | if err != nil { |
| 67 | return nil, err |
| 68 | } |
| 69 | vol.isPeer = true |
| 70 | return vol, nil |
| 71 | }) |
| 72 | } |
| 73 | |
| 74 | func withEndpoint[T any](ctx context.Context, loc PeerLocator, peer blobcache.NodeID, fn func(blobcache.Endpoint) (T, error)) (T, error) { |
| 75 | var ret T |
nothing calls this directly
no test coverage detected