mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-18 19:07:55 +08:00
auto list of storage types
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user