Files
seaweedfs/weed/storage/needle/volume_id.go

19 lines
351 B
Go
Raw Normal View History

2019-04-18 21:43:36 -07:00
package needle
2012-08-23 23:24:32 -07:00
import (
2013-01-17 00:56:56 -08:00
"strconv"
2012-08-23 23:24:32 -07:00
)
type VolumeId uint32
2013-01-17 00:56:56 -08:00
func NewVolumeId(vid string) (VolumeId, error) {
volumeId, err := strconv.ParseUint(vid, 10, 64)
return VolumeId(volumeId), err
2012-08-23 23:24:32 -07:00
}
2019-04-20 18:39:06 +08:00
func (vid VolumeId) String() string {
return strconv.FormatUint(uint64(vid), 10)
2012-08-23 23:24:32 -07:00
}
2019-04-20 18:39:06 +08:00
func (vid VolumeId) Next() VolumeId {
return VolumeId(uint32(vid) + 1)
2012-08-29 01:37:40 -07:00
}