aboutsummaryrefslogtreecommitdiff
path: root/weed/wdclient
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-01-06 04:21:34 -0800
committerChris Lu <chris.lu@gmail.com>2021-01-06 04:22:00 -0800
commit2b7685464139e8fbfedbb357f72c4ff70bd869e1 (patch)
tree74ee5a6e9f15003bc659da47a8a806bcfdb6a416 /weed/wdclient
parent95ecf0c72f57f7b8cc96cb9099b79bc8ead9b80d (diff)
downloadseaweedfs-2b7685464139e8fbfedbb357f72c4ff70bd869e1.tar.xz
seaweedfs-2b7685464139e8fbfedbb357f72c4ff70bd869e1.zip
add "weed filer.cat" to read files directly from volume servers
Diffstat (limited to 'weed/wdclient')
-rw-r--r--weed/wdclient/vid_map.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/weed/wdclient/vid_map.go b/weed/wdclient/vid_map.go
index 773da0191..271baa132 100644
--- a/weed/wdclient/vid_map.go
+++ b/weed/wdclient/vid_map.go
@@ -15,6 +15,12 @@ const (
maxCursorIndex = 4096
)
+type HasLookupFileIdFunction interface {
+ GetLookupFileIdFunction() LookupFileIdFunctionType
+}
+
+type LookupFileIdFunctionType func(fileId string) (targetUrls []string, err error)
+
type Location struct {
Url string `json:"url,omitempty"`
PublicUrl string `json:"publicUrl,omitempty"`
@@ -67,6 +73,10 @@ func (vc *vidMap) LookupVolumeServerUrl(vid string) (serverUrls []string, err er
return
}
+func (vc *vidMap) GetLookupFileIdFunction() LookupFileIdFunctionType {
+ return vc.LookupFileId
+}
+
func (vc *vidMap) LookupFileId(fileId string) (fullUrls []string, err error) {
parts := strings.Split(fileId, ",")
if len(parts) != 2 {