Skip to content

Commit

Permalink
[UPGRADE] 更新依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
xuanbo committed Jun 12, 2019
1 parent 58d04e7 commit 00c8ef8
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 15 deletions.
1 change: 1 addition & 0 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
)

// 与eureka服务端rest交互
// https://github.com/Netflix/eureka/wiki/Eureka-REST-operations

// Register 注册实例
// POST /eureka/v2/apps/appID
Expand Down
10 changes: 6 additions & 4 deletions examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import (
func main() {
// create eureka client
client := eureka.NewClient(&eureka.Config{
DefaultZone: "http://127.0.0.1:8080/eureka/",
App: "golang-example",
Port: 10000,
DefaultZone: "http://127.0.0.1:8080/eureka/",
App: "go-example",
Port: 10000,
RenewalIntervalInSecs: 10,
DurationInSecs: 30,
Metadata: map[string]interface{}{
"VERSION": "0.1.0",
"NODE_GROUP_ID": 0,
Expand All @@ -27,7 +29,7 @@ func main() {
client.Start()

// http server
http.HandleFunc("/services", func(writer http.ResponseWriter, request *http.Request) {
http.HandleFunc("/v1/services", func(writer http.ResponseWriter, request *http.Request) {
// full applications from eureka server
apps := client.Applications

Expand Down
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
module github.com/xuanbo/eureka-client

require (
github.com/ArthurHlt/go-eureka-client v1.1.0
github.com/xuanbo/requests v0.0.1
)
require github.com/xuanbo/requests v0.0.1
10 changes: 7 additions & 3 deletions readme-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

## 未完成

* 当eureka服务端重启后,心跳404时支持重新注册

* 以delta方式刷新服务列表(增量拉取)

如果delta被禁用或者首次刷新,则使用全量拉取
Expand All @@ -31,9 +33,11 @@ import (
func main() {
// 创建客户端
client := eureka.NewClient(&eureka.Config{
DefaultZone: "http://127.0.0.1:8080/eureka/",
App: "golang-example",
Port: 10000,
DefaultZone: "http://127.0.0.1:8080/eureka/",
App: "go-example",
Port: 10000,
RenewalIntervalInSecs: 10,
DurationInSecs: 30,
Metadata: map[string]interface{}{
"VERSION": "0.1.0",
"NODE_GROUP_ID": 0,
Expand Down
11 changes: 7 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

## Todo

* Re-Register

* Refresh by delta

If the delta is disabled or if it is the first time, get all applications
Expand All @@ -31,10 +33,11 @@ import (
func main() {
// create eureka client
client := eureka.NewClient(&eureka.Config{
// DefaultZone: "http://dev.hdsp.hand.com:8000/eureka/",
DefaultZone: "http://127.0.0.1:8080/eureka/",
App: "golang-example",
Port: 10000,
DefaultZone: "http://127.0.0.1:8080/eureka/",
App: "go-example",
Port: 10000,
RenewalIntervalInSecs: 10,
DurationInSecs: 30,
Metadata: map[string]interface{}{
"VERSION": "0.1.0",
"NODE_GROUP_ID": 0,
Expand Down

0 comments on commit 00c8ef8

Please sign in to comment.