register fix
This commit is contained in:
parent
34ace207a7
commit
e5c95b0476
@ -23,16 +23,16 @@ type Service struct {
|
||||
|
||||
var ErrServiceUnavailable = fmt.Errorf("Service is unavailable")
|
||||
|
||||
func NewService(serverAddr, appID, appName, ip, domain string, appPort int) (*Service, error) {
|
||||
func NewService(servAddr, id, appName, ip, domain string, appPort int) (*Service, error) {
|
||||
s := new(Service)
|
||||
s.AppID = appID
|
||||
s.AppID = id
|
||||
s.Name = strings.Replace(appName, "-", "", -1)
|
||||
s.Address = domain
|
||||
s.IP = ip
|
||||
s.Port = appPort
|
||||
s.TTL = time.Second * 15
|
||||
|
||||
client, err := consul.NewClient(newClientConfig(serverAddr))
|
||||
client, err := consul.NewClient(newClientConfig(servAddr))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user