added typed join result

This commit is contained in:
Chris Lu
2014-04-16 17:29:58 -07:00
parent da0480ad72
commit 9653a54766
4 changed files with 16 additions and 9 deletions

View File

@@ -251,10 +251,6 @@ func (s *Store) Status() []*VolumeInfo {
return stats
}
type JoinResult struct {
VolumeSizeLimit uint64
}
func (s *Store) SetDataCenter(dataCenter string) {
s.dataCenter = dataCenter
}
@@ -303,10 +299,13 @@ func (s *Store) Join() error {
s.masterNodes.reset()
return err
}
var ret JoinResult
var ret operation.JoinResult
if err := json.Unmarshal(jsonBlob, &ret); err != nil {
return err
}
if ret.Error != "" {
return errors.New(ret.Error)
}
s.volumeSizeLimit = ret.VolumeSizeLimit
s.connected = true
return nil