20318: Add comments about KeepClient/KeepGateway wiring.
authorTom Clegg <tom@curii.com>
Mon, 8 Jan 2024 16:37:53 +0000 (11:37 -0500)
committerTom Clegg <tom@curii.com>
Mon, 8 Jan 2024 16:37:53 +0000 (11:37 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

sdk/go/arvados/keep_cache.go
sdk/go/keepclient/gateway_shim.go

index 2b578bd1dea4a87535bf4e03a1b226a73da641a6..5f1535e7ca7344e6a805b75166ade710944c8f3f 100644 (file)
@@ -34,6 +34,10 @@ type KeepGateway interface {
 }
 
 // DiskCache wraps KeepGateway, adding a disk-based cache layer.
+//
+// A DiskCache is automatically incorporated into the backend stack of
+// each keepclient.KeepClient. Most programs do not need to use
+// DiskCache directly.
 type DiskCache struct {
        KeepGateway
        Dir     string
index eeb187e10735f0cc0d6f94757dece828df7301a4..0675ed9877bf2aafb4492b1618c659d8abc7387a 100644 (file)
@@ -17,6 +17,12 @@ import (
 
 // keepViaHTTP implements arvados.KeepGateway by using a KeepClient to
 // do upstream requests to keepstore and keepproxy.
+//
+// This enables KeepClient to use KeepGateway wrappers (like
+// arvados.DiskCache) to wrap its own HTTP client back-end methods
+// (getOrHead, httpBlockWrite).
+//
+// See (*KeepClient)upstreamGateway() for the relevant glue.
 type keepViaHTTP struct {
        *KeepClient
 }