liuxiaolong
2020-03-12 4497238bd859b8351b4eeb7ba6d00ef9264575c4
fix interface to []byte
2个文件已修改
14 ■■■■ 已修改文件
client.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
server.go 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
client.go
@@ -48,7 +48,7 @@
type ServiceInfo struct {
    ServiceId string `json:"serviceId"`
    Info interface{} `json:"info"`
    Info []byte `json:"info"`
}
func Client(urlServer string, serviceId string) (*DiscoveryClient, error) {
@@ -115,7 +115,7 @@
    d.cancel()
}
func (d *DiscoveryClient) SetResp(i interface{}) {
func (d *DiscoveryClient) SetResp(i []byte) {
    d.service.Info = i
}
server.go
@@ -51,7 +51,7 @@
    // publisher, we are going to publish the changes of the set here
    publisher *Publisher
    svInfo map[string]interface{}
    svInfo map[string][]byte
}
type Publisher struct {
@@ -150,7 +150,7 @@
    }
    responses = NewStringSet()
    d.services.svInfo = make(map[string]interface{}, 0)
    d.services.svInfo = make(map[string][]byte, 0)
    for {
        msg, err = d.sock.Recv()
        if err != nil {
@@ -219,7 +219,7 @@
    s := &Services{
        nodes:     NewStringSet(),
        publisher: publisher,
        svInfo: make(map[string]interface{}, 0),
        svInfo: make(map[string][]byte, 0),
    }
    return s
@@ -243,8 +243,8 @@
    return d.services.nodes
}
func (d *DiscoveryServer) SvInfo() map[string]interface{} {
    m := make(map[string]interface{})
func (d *DiscoveryServer) SvInfo() map[string][]byte {
    m := make(map[string][]byte)
    for k,v := range d.services.svInfo {
        m[k] = v
    }