Skip to content

Commit

Permalink
Merge pull request micro#1 from micro/master
Browse files Browse the repository at this point in the history
Update forks to latest
  • Loading branch information
xpunch authored Aug 9, 2019
2 parents 59eaa89 + 057adb2 commit b13604f
Show file tree
Hide file tree
Showing 193 changed files with 10,159 additions and 2,143 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
language: go
go:
- 1.11.x
- 1.12.x
env:
- GO111MODULE=on
notifications:
slack:
secure: aEvhLbhujaGaKSrOokiG3//PaVHTIrc3fBpoRbCRqfZpyq6WREoapJJhF+tIpWWOwaC9GmChbD6aHo/jMUgwKXVyPSaNjiEL87YzUUpL8B2zslNp1rgfTg/LrzthOx3Q1TYwpaAl3to0fuHUVFX4yMeC2vuThq7WSXgMMxFCtbc=
cache:
directories:
- $GOPATH/pkg/mod
197 changes: 0 additions & 197 deletions agent/README.md

This file was deleted.

18 changes: 0 additions & 18 deletions api/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion api/handler/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"github.com/micro/go-micro/api/handler"
api "github.com/micro/go-micro/api/proto"
"github.com/micro/go-micro/client"
"github.com/micro/go-micro/client/selector"
"github.com/micro/go-micro/errors"
"github.com/micro/go-micro/selector"
"github.com/micro/go-micro/util/ctx"
)

Expand Down
2 changes: 1 addition & 1 deletion api/handler/api/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"strings"

api "github.com/micro/go-micro/api/proto"
"github.com/micro/go-micro/client/selector"
"github.com/micro/go-micro/registry"
"github.com/micro/go-micro/selector"
)

func requestToProto(r *http.Request) (*api.Request, error) {
Expand Down
2 changes: 1 addition & 1 deletion api/handler/broker/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (c *conn) writeLoop() {
opts = append(opts, broker.Queue(c.queue))
}

subscriber, err := c.b.Subscribe(c.topic, func(p broker.Publication) error {
subscriber, err := c.b.Subscribe(c.topic, func(p broker.Event) error {
b, err := json.Marshal(p.Message())
if err != nil {
return nil
Expand Down
4 changes: 2 additions & 2 deletions api/handler/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/micro/go-micro/api"
"github.com/micro/go-micro/api/handler"
"github.com/micro/go-micro/selector"
"github.com/micro/go-micro/client/selector"
)

const (
Expand Down Expand Up @@ -73,7 +73,7 @@ func (h *httpHandler) getService(r *http.Request) (string, error) {
return "", nil
}

return fmt.Sprintf("http://%s:%d", s.Address, s.Port), nil
return fmt.Sprintf("http://%s", s.Address), nil
}

func (h *httpHandler) String() string {
Expand Down
15 changes: 2 additions & 13 deletions api/handler/http/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import (
"net"
"net/http"
"net/http/httptest"
"strconv"
"strings"
"testing"

"github.com/micro/go-micro/api/handler"
"github.com/micro/go-micro/api/router"
regRouter "github.com/micro/go-micro/api/router/registry"
"github.com/micro/go-micro/cmd"
"github.com/micro/go-micro/config/cmd"
"github.com/micro/go-micro/registry"
"github.com/micro/go-micro/registry/memory"
)
Expand All @@ -26,21 +24,12 @@ func testHttp(t *testing.T, path, service, ns string) {
}
defer l.Close()

parts := strings.Split(l.Addr().String(), ":")

var host string
var port int

host = parts[0]
port, _ = strconv.Atoi(parts[1])

s := &registry.Service{
Name: service,
Nodes: []*registry.Node{
&registry.Node{
Id: service + "-1",
Address: host,
Port: port,
Address: l.Addr().String(),
},
},
}
Expand Down
Loading

0 comments on commit b13604f

Please sign in to comment.