diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-09-04 00:18:21 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-09-04 00:18:21 -0700 |
| commit | da49d25950095d9517a767a9d8fe9628ef4c4e80 (patch) | |
| tree | 0a3e9ea84c77f038e500a2e6fd5926a182611af7 /weed/remote_storage | |
| parent | 38f73c8324c299773f7d2ab40bdeb48af6421c86 (diff) | |
| download | seaweedfs-da49d25950095d9517a767a9d8fe9628ef4c4e80.tar.xz seaweedfs-da49d25950095d9517a767a9d8fe9628ef4c4e80.zip | |
auto list of storage types
Diffstat (limited to 'weed/remote_storage')
| -rw-r--r-- | weed/remote_storage/remote_storage.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/weed/remote_storage/remote_storage.go b/weed/remote_storage/remote_storage.go index 15e6fb2d5..d8d1e1f5c 100644 --- a/weed/remote_storage/remote_storage.go +++ b/weed/remote_storage/remote_storage.go @@ -6,6 +6,7 @@ import ( "github.com/chrislusf/seaweedfs/weed/pb/remote_pb" "github.com/golang/protobuf/proto" "io" + "sort" "strings" "sync" "time" @@ -100,6 +101,26 @@ var ( remoteStorageClientsLock sync.Mutex ) +func GetAllRemoteStorageNames() string { + var storageNames []string + for k := range RemoteStorageClientMakers { + storageNames = append(storageNames, k) + } + sort.Strings(storageNames) + return strings.Join(storageNames, "|") +} + +func GetRemoteStorageNamesHasBucket() string { + var storageNames []string + for k, m := range RemoteStorageClientMakers { + if m.HasBucket() { + storageNames = append(storageNames, k) + } + } + sort.Strings(storageNames) + return strings.Join(storageNames, "|") +} + func ParseRemoteLocation(remoteConfType string, remote string) (remoteStorageLocation *remote_pb.RemoteStorageLocation, err error) { maker, found := RemoteStorageClientMakers[remoteConfType] if !found { |
