|
|
@ -1,7 +1,6 @@
|
|
|
|
package main
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
|
|
|
|
"context"
|
|
|
|
"context"
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"net"
|
|
|
|
"net"
|
|
|
@ -10,8 +9,6 @@ import (
|
|
|
|
"strconv"
|
|
|
|
"strconv"
|
|
|
|
"time"
|
|
|
|
"time"
|
|
|
|
|
|
|
|
|
|
|
|
"gopkg.in/yaml.v3"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"net/http"
|
|
|
|
"net/http"
|
|
|
|
_ "net/http/pprof"
|
|
|
|
_ "net/http/pprof"
|
|
|
|
|
|
|
|
|
|
|
@ -61,12 +58,8 @@ func run(port int) error {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fmt.Println("api init discov client success")
|
|
|
|
fmt.Println("api init discov client success")
|
|
|
|
buf := bytes.NewBuffer(nil)
|
|
|
|
|
|
|
|
if err := yaml.NewEncoder(buf).Encode(config.Config); err != nil {
|
|
|
|
|
|
|
|
return err
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
fmt.Println("api register public config to discov")
|
|
|
|
fmt.Println("api register public config to discov")
|
|
|
|
if err := client.RegisterConf2Registry(constant.OpenIMCommonConfigKey, buf.Bytes()); err != nil {
|
|
|
|
if err := client.RegisterConf2Registry(constant.OpenIMCommonConfigKey, config.EncodeConfig()); err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fmt.Println("api register public config to discov success")
|
|
|
|
fmt.Println("api register public config to discov success")
|
|
|
|