register fix
This commit is contained in:
parent
ceaeecf1b4
commit
6c46a0e6a4
@ -26,7 +26,7 @@ var ErrServiceUnavailable = fmt.Errorf("Service is unavailable")
|
|||||||
func NewService(serverAddr, appID, appName, ip, domain string, appPort int) (*Service, error) {
|
func NewService(serverAddr, appID, appName, ip, domain string, appPort int) (*Service, error) {
|
||||||
s := new(Service)
|
s := new(Service)
|
||||||
s.AppID = appID
|
s.AppID = appID
|
||||||
s.Name = appName
|
s.Name = strings.Replace(appName, "-", "_", -1)
|
||||||
s.Address = domain
|
s.Address = domain
|
||||||
s.IP = ip
|
s.IP = ip
|
||||||
s.Port = appPort
|
s.Port = appPort
|
||||||
@ -59,7 +59,7 @@ func (s *Service) GetFullAddr() string {
|
|||||||
func (s *Service) Register() error {
|
func (s *Service) Register() error {
|
||||||
def := &consul.AgentServiceRegistration{
|
def := &consul.AgentServiceRegistration{
|
||||||
ID: s.GetID(),
|
ID: s.GetID(),
|
||||||
Name: strings.Replace(s.Name, "-", "_", -1),
|
Name: s.Name,
|
||||||
Address: s.IP,
|
Address: s.IP,
|
||||||
Port: s.Port,
|
Port: s.Port,
|
||||||
Tags: s.getTags(),
|
Tags: s.getTags(),
|
||||||
|
Loading…
Reference in New Issue
Block a user