Merge branch '18691-freeze-project'
[arvados.git] / sdk / go / arvados / fs_backend.go
index 301f0b48bede74b63f1141b7b295e346824c3888..cc4c32ffe9bc520e48a46da858b6037b541f8bb4 100644 (file)
@@ -4,7 +4,11 @@
 
 package arvados
 
-import "io"
+import (
+       "context"
+       "errors"
+       "io"
+)
 
 type fsBackend interface {
        keepClient
@@ -20,10 +24,23 @@ type keepBackend struct {
 
 type keepClient interface {
        ReadAt(locator string, p []byte, off int) (int, error)
-       PutB(p []byte) (string, int, error)
+       BlockWrite(context.Context, BlockWriteOptions) (BlockWriteResponse, error)
+       LocalLocator(locator string) (string, error)
 }
 
 type apiClient interface {
        RequestAndDecode(dst interface{}, method, path string, body io.Reader, params interface{}) error
-       UpdateBody(rsc resource) io.Reader
+}
+
+var errStubClient = errors.New("stub client")
+
+type StubClient struct{}
+
+func (*StubClient) ReadAt(string, []byte, int) (int, error) { return 0, errStubClient }
+func (*StubClient) LocalLocator(loc string) (string, error) { return loc, nil }
+func (*StubClient) BlockWrite(context.Context, BlockWriteOptions) (BlockWriteResponse, error) {
+       return BlockWriteResponse{}, errStubClient
+}
+func (*StubClient) RequestAndDecode(_ interface{}, _, _ string, _ io.Reader, _ interface{}) error {
+       return errStubClient
 }