loading from json setup in tests

This commit is contained in:
Chris Lu
2012-08-31 01:35:11 -07:00
parent f5d981ab4d
commit 8d0ea07f5f
6 changed files with 186 additions and 17 deletions

View File

@@ -2,6 +2,7 @@ package topology
import (
"pkg/storage"
_ "fmt"
)
type Server struct {
@@ -11,6 +12,12 @@ type Server struct {
Port int
PublicUrl string
}
func NewServer(id NodeId) *Server{
s := &Server{}
s.Node.Id = id
s.volumes = make(map[storage.VolumeId]*storage.VolumeInfo)
return s
}
func (s *Server) CreateOneVolume(r int, vid storage.VolumeId) storage.VolumeId {
s.AddVolume(&storage.VolumeInfo{Id:vid, Size: 32*1024*1024*1024})
return vid