diff options
| author | Chris Lu <chris.lu@gmail.com> | 2014-04-16 17:29:58 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2014-04-16 17:29:58 -0700 |
| commit | 9653a54766fbb7d9e7453c0df0eb0de016cfbce6 (patch) | |
| tree | bf8637d973a336286c31d83cf5a9198b9af4a3f4 /go/storage | |
| parent | da0480ad728af0bbccc63ec802283c6f54b17658 (diff) | |
| download | seaweedfs-9653a54766fbb7d9e7453c0df0eb0de016cfbce6.tar.xz seaweedfs-9653a54766fbb7d9e7453c0df0eb0de016cfbce6.zip | |
added typed join result
Diffstat (limited to 'go/storage')
| -rw-r--r-- | go/storage/store.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/go/storage/store.go b/go/storage/store.go index 6a853122f..157344781 100644 --- a/go/storage/store.go +++ b/go/storage/store.go @@ -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 |
