mirror of
https://github.com/go-gitea/gitea
synced 2024-09-17 17:26:05 +00:00
b6a95a8cb3
* 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
31 lines
506 B
Go
31 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
|
|
}
|