|
@ -20,7 +20,6 @@ type VolumeServer struct { |
|
|
pulseSeconds int |
|
|
pulseSeconds int |
|
|
dataCenter string |
|
|
dataCenter string |
|
|
rack string |
|
|
rack string |
|
|
DiskType storage.DiskType |
|
|
|
|
|
store *storage.Store |
|
|
store *storage.Store |
|
|
guard *security.Guard |
|
|
guard *security.Guard |
|
|
grpcDialOption grpc.DialOption |
|
|
grpcDialOption grpc.DialOption |
|
@ -38,7 +37,7 @@ type VolumeServer struct { |
|
|
|
|
|
|
|
|
func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string, |
|
|
func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string, |
|
|
port int, publicUrl string, |
|
|
port int, publicUrl string, |
|
|
folders []string, maxCounts []int, minFreeSpacePercents []float32, diskType storage.DiskType, |
|
|
|
|
|
|
|
|
folders []string, maxCounts []int, minFreeSpacePercents []float32, diskTypes []storage.DiskType, |
|
|
idxFolder string, |
|
|
idxFolder string, |
|
|
needleMapKind storage.NeedleMapType, |
|
|
needleMapKind storage.NeedleMapType, |
|
|
masterNodes []string, pulseSeconds int, |
|
|
masterNodes []string, pulseSeconds int, |
|
@ -64,7 +63,6 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string, |
|
|
pulseSeconds: pulseSeconds, |
|
|
pulseSeconds: pulseSeconds, |
|
|
dataCenter: dataCenter, |
|
|
dataCenter: dataCenter, |
|
|
rack: rack, |
|
|
rack: rack, |
|
|
DiskType: diskType, |
|
|
|
|
|
needleMapKind: needleMapKind, |
|
|
needleMapKind: needleMapKind, |
|
|
FixJpgOrientation: fixJpgOrientation, |
|
|
FixJpgOrientation: fixJpgOrientation, |
|
|
ReadRedirect: readRedirect, |
|
|
ReadRedirect: readRedirect, |
|
@ -78,7 +76,7 @@ func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string, |
|
|
|
|
|
|
|
|
vs.checkWithMaster() |
|
|
vs.checkWithMaster() |
|
|
|
|
|
|
|
|
vs.store = storage.NewStore(vs.grpcDialOption, port, ip, publicUrl, folders, maxCounts, minFreeSpacePercents, idxFolder, vs.needleMapKind, vs.DiskType) |
|
|
|
|
|
|
|
|
vs.store = storage.NewStore(vs.grpcDialOption, port, ip, publicUrl, folders, maxCounts, minFreeSpacePercents, idxFolder, vs.needleMapKind, diskTypes) |
|
|
vs.guard = security.NewGuard(whiteList, signingKey, expiresAfterSec, readSigningKey, readExpiresAfterSec) |
|
|
vs.guard = security.NewGuard(whiteList, signingKey, expiresAfterSec, readSigningKey, readExpiresAfterSec) |
|
|
|
|
|
|
|
|
handleStaticResources(adminMux) |
|
|
handleStaticResources(adminMux) |
|
|