* Dropped unused codekit config * Integrated dynamic and static bindata for public * Ignore public bindata * Add a general generate make task * Integrated flexible public assets into web command * Updated vendoring, added all missiong govendor deps * Made the linter happy with the bindata and dynamic code * Moved public bindata definition to modules directory * Ignoring the new bindata path now * Updated to the new public modules import path * Updated public bindata command and drop the new prefix
30 lines
506 B
Go
30 lines
506 B
Go
package etcd
|
|
|
|
import "encoding/json"
|
|
|
|
type Member struct {
|
|
ID string `json:"id"`
|
|
Name string `json:"name"`
|
|
PeerURLs []string `json:"peerURLs"`
|
|
ClientURLs []string `json:"clientURLs"`
|
|
}
|
|
|
|
type memberCollection []Member
|
|
|
|
func (c *memberCollection) UnmarshalJSON(data []byte) error {
|
|
d := struct {
|
|
Members []Member
|
|
}{}
|
|
|
|
if err := json.Unmarshal(data, &d); err != nil {
|
|
return err
|
|
}
|
|
|
|
if d.Members == nil {
|
|
*c = make([]Member, 0)
|
|
return nil
|
|
}
|
|
|
|
*c = d.Members
|
|
return nil
|
|
}
|