Skip to content

Commit

Permalink
Merge pull request #67 from hookszhang/dev
Browse files Browse the repository at this point in the history
Add property instanceId and optimize
  • Loading branch information
damtur committed Jun 14, 2018
2 parents d214741 + 37138cc commit fce5cf4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.test
eureka
.vagrant/
.idea/
3 changes: 3 additions & 0 deletions net.go
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,9 @@ func (e *EurekaConnection) HeartBeatInstance(ins *Instance) error {
}

func (i *Instance) Id() string {
if i.InstanceId != "" {
return i.InstanceId
}
if i.UniqueID != nil {
return i.UniqueID(*i)
}
Expand Down
1 change: 1 addition & 0 deletions struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ type RegisterInstanceJson struct {

// Instance [de]serializeable [to|from] Eureka [XML|JSON].
type Instance struct {
InstanceId string `xml:"instanceId" json:"instanceId"`
HostName string `xml:"hostName" json:"hostName"`
App string `xml:"app" json:"app"`
IPAddr string `xml:"ipAddr" json:"ipAddr"`
Expand Down

0 comments on commit fce5cf4

Please sign in to comment.