mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-24 06:50:40 +02:00
simplify volume.go file
This commit is contained in:
1 parent
0c32e2e965
commit
9b4ce65882
3 files changed
+24
-13
No files matched your search
@@ -5,7 +5,6 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
"strconv"
|
||||
"sync"
|
||||
)
|
||||
|
||||
@@ -13,18 +12,6 @@ const (
|
||||
SuperBlockSize = 8
|
||||
)
|
||||
|
||||
type VolumeId uint32
|
||||
type VolumeInfo struct {
|
||||
Id VolumeId
|
||||
Size int64
|
||||
}
|
||||
func NewVolumeId(vid string) (VolumeId,error) {
|
||||
volumeId, err := strconv.ParseUint(vid, 10, 64)
|
||||
return VolumeId(volumeId), err
|
||||
}
|
||||
func (vid *VolumeId) String() string{
|
||||
return strconv.FormatUint(uint64(*vid), 10)
|
||||
}
|
||||
type Volume struct {
|
||||
Id VolumeId
|
||||
dir string
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package storage
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type VolumeId uint32
|
||||
func NewVolumeId(vid string) (VolumeId,error) {
|
||||
volumeId, err := strconv.ParseUint(vid, 10, 64)
|
||||
return VolumeId(volumeId), err
|
||||
}
|
||||
func (vid *VolumeId) String() string{
|
||||
return strconv.FormatUint(uint64(*vid), 10)
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package storage
|
||||
|
||||
import (
|
||||
|
||||
)
|
||||
|
||||
type VolumeInfo struct {
|
||||
Id VolumeId
|
||||
Size int64
|
||||
}
|
||||
Reference in new issue
Block a user