1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
13 type fsBackend interface {
18 // Ideally *Client would do everything; meanwhile keepBackend
19 // implements fsBackend by merging the two kinds of arvados client.
20 type keepBackend struct {
25 type keepClient interface {
26 ReadAt(locator string, p []byte, off int) (int, error)
27 BlockWrite(context.Context, BlockWriteOptions) (BlockWriteResponse, error)
28 LocalLocator(locator string) (string, error)
31 type apiClient interface {
32 RequestAndDecode(dst interface{}, method, path string, body io.Reader, params interface{}) error
35 var errStubClient = errors.New("stub client")
37 type StubClient struct{}
39 func (*StubClient) ReadAt(string, []byte, int) (int, error) { return 0, errStubClient }
40 func (*StubClient) LocalLocator(loc string) (string, error) { return loc, nil }
41 func (*StubClient) BlockWrite(context.Context, BlockWriteOptions) (BlockWriteResponse, error) {
42 return BlockWriteResponse{}, errStubClient
44 func (*StubClient) RequestAndDecode(_ interface{}, _, _ string, _ io.Reader, _ interface{}) error {