update links from myodc to micro
This commit is contained in:
parent
9b23729eac
commit
5d88115f2a
28
README.md
28
README.md
@ -1,6 +1,6 @@
|
|||||||
# Go Micro [![GoDoc](https://godoc.org/github.com/myodc/go-micro?status.svg)](https://godoc.org/github.com/myodc/go-micro) [![Travis CI](https://travis-ci.org/myodc/go-micro.svg?branch=master)](https://travis-ci.org/myodc/go-micro)
|
# Go Micro [![GoDoc](https://godoc.org/github.com/micro/go-micro?status.svg)](https://godoc.org/github.com/micro/go-micro) [![Travis CI](https://travis-ci.org/micro/go-micro.svg?branch=master)](https://travis-ci.org/micro/go-micro)
|
||||||
|
|
||||||
Go Micro is a microservices library which provides the fundamental building blocks for writing fault tolerant distributed systems at scale. It is part of the [Micro](https://github.com/myodc/micro) toolchain.
|
Go Micro is a microservices library which provides the fundamental building blocks for writing fault tolerant distributed systems at scale. It is part of the [Micro](https://github.com/micro/micro) toolchain.
|
||||||
|
|
||||||
An example server can be found in examples/server.
|
An example server can be found in examples/server.
|
||||||
|
|
||||||
@ -11,11 +11,11 @@ An example server can be found in examples/server.
|
|||||||
|
|
||||||
Feature | Package | Description
|
Feature | Package | Description
|
||||||
------- | ------- | ---------
|
------- | ------- | ---------
|
||||||
Discovery | [Registry](https://godoc.org/github.com/myodc/go-micro/registry) | A way of locating services to communicate with
|
Discovery | [Registry](https://godoc.org/github.com/micro/go-micro/registry) | A way of locating services to communicate with
|
||||||
Client | [Client](https://godoc.org/github.com/myodc/go-micro/client) | Used to make RPC requests to a service
|
Client | [Client](https://godoc.org/github.com/micro/go-micro/client) | Used to make RPC requests to a service
|
||||||
Server | [Server](https://godoc.org/github.com/myodc/go-micro/server) | Listens and serves RPC requests
|
Server | [Server](https://godoc.org/github.com/micro/go-micro/server) | Listens and serves RPC requests
|
||||||
Pub/Sub | [Broker](https://godoc.org/github.com/myodc/go-micro/broker) | Publish and Subscribe to events
|
Pub/Sub | [Broker](https://godoc.org/github.com/micro/go-micro/broker) | Publish and Subscribe to events
|
||||||
Transport | [Transport](https://godoc.org/github.com/myodc/go-micro/transport) | Communication mechanism between services
|
Transport | [Transport](https://godoc.org/github.com/micro/go-micro/transport) | Communication mechanism between services
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ message Response {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Compile proto `protoc -I$GOPATH/src --go_out=$GOPATH/src $GOPATH/src/github.com/myodc/go-micro/examples/server/proto/example/example.proto`
|
Compile proto `protoc -I$GOPATH/src --go_out=$GOPATH/src $GOPATH/src/github.com/micro/go-micro/examples/server/proto/example/example.proto`
|
||||||
|
|
||||||
### Create request handler
|
### Create request handler
|
||||||
`go-micro/examples/server/handler/example.go`:
|
`go-micro/examples/server/handler/example.go`:
|
||||||
@ -73,9 +73,9 @@ package handler
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
log "github.com/golang/glog"
|
log "github.com/golang/glog"
|
||||||
c "github.com/myodc/go-micro/context"
|
c "github.com/micro/go-micro/context"
|
||||||
example "github.com/myodc/go-micro/examples/server/proto/example"
|
example "github.com/micro/go-micro/examples/server/proto/example"
|
||||||
"github.com/myodc/go-micro/server"
|
"github.com/micro/go-micro/server"
|
||||||
|
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
@ -98,9 +98,9 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
log "github.com/golang/glog"
|
log "github.com/golang/glog"
|
||||||
"github.com/myodc/go-micro/cmd"
|
"github.com/micro/go-micro/cmd"
|
||||||
"github.com/myodc/go-micro/examples/server/handler"
|
"github.com/micro/go-micro/examples/server/handler"
|
||||||
"github.com/myodc/go-micro/server"
|
"github.com/micro/go-micro/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -3,7 +3,7 @@ package http
|
|||||||
// This is a hack
|
// This is a hack
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/myodc/go-micro/broker"
|
"github.com/micro/go-micro/broker"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewBroker(addrs []string, opt ...broker.Option) broker.Broker {
|
func NewBroker(addrs []string, opt ...broker.Option) broker.Broker {
|
||||||
|
@ -12,8 +12,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
log "github.com/golang/glog"
|
log "github.com/golang/glog"
|
||||||
"github.com/myodc/go-micro/errors"
|
"github.com/micro/go-micro/errors"
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"github.com/pborman/uuid"
|
"github.com/pborman/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/apcera/nats"
|
"github.com/apcera/nats"
|
||||||
"github.com/myodc/go-micro/broker"
|
"github.com/micro/go-micro/broker"
|
||||||
)
|
)
|
||||||
|
|
||||||
type nbroker struct {
|
type nbroker struct {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package rabbitmq
|
package rabbitmq
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/myodc/go-micro/broker"
|
"github.com/micro/go-micro/broker"
|
||||||
"github.com/streadway/amqp"
|
"github.com/streadway/amqp"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ import (
|
|||||||
"math/rand"
|
"math/rand"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/myodc/go-micro/errors"
|
"github.com/micro/go-micro/errors"
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -3,7 +3,7 @@ package client
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestNodeSelector(t *testing.T) {
|
func TestNodeSelector(t *testing.T) {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/myodc/go-micro/broker"
|
"github.com/micro/go-micro/broker"
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"github.com/myodc/go-micro/transport"
|
"github.com/micro/go-micro/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type options struct {
|
type options struct {
|
||||||
|
@ -6,11 +6,11 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/myodc/go-micro/broker"
|
"github.com/micro/go-micro/broker"
|
||||||
c "github.com/myodc/go-micro/context"
|
c "github.com/micro/go-micro/context"
|
||||||
"github.com/myodc/go-micro/errors"
|
"github.com/micro/go-micro/errors"
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"github.com/myodc/go-micro/transport"
|
"github.com/micro/go-micro/transport"
|
||||||
|
|
||||||
rpc "github.com/youtube/vitess/go/rpcplus"
|
rpc "github.com/youtube/vitess/go/rpcplus"
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/myodc/go-micro/transport"
|
"github.com/micro/go-micro/transport"
|
||||||
rpc "github.com/youtube/vitess/go/rpcplus"
|
rpc "github.com/youtube/vitess/go/rpcplus"
|
||||||
js "github.com/youtube/vitess/go/rpcplus/jsonrpc"
|
js "github.com/youtube/vitess/go/rpcplus/jsonrpc"
|
||||||
pb "github.com/youtube/vitess/go/rpcplus/pbrpc"
|
pb "github.com/youtube/vitess/go/rpcplus/pbrpc"
|
||||||
|
28
cmd/cmd.go
28
cmd/cmd.go
@ -10,26 +10,26 @@ import (
|
|||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
"github.com/codegangsta/cli"
|
"github.com/codegangsta/cli"
|
||||||
"github.com/myodc/go-micro/broker"
|
"github.com/micro/go-micro/broker"
|
||||||
"github.com/myodc/go-micro/client"
|
"github.com/micro/go-micro/client"
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"github.com/myodc/go-micro/server"
|
"github.com/micro/go-micro/server"
|
||||||
"github.com/myodc/go-micro/transport"
|
"github.com/micro/go-micro/transport"
|
||||||
|
|
||||||
// brokers
|
// brokers
|
||||||
"github.com/myodc/go-micro/broker/http"
|
"github.com/micro/go-micro/broker/http"
|
||||||
"github.com/myodc/go-micro/broker/nats"
|
"github.com/micro/go-micro/broker/nats"
|
||||||
"github.com/myodc/go-micro/broker/rabbitmq"
|
"github.com/micro/go-micro/broker/rabbitmq"
|
||||||
|
|
||||||
// registries
|
// registries
|
||||||
"github.com/myodc/go-micro/registry/consul"
|
"github.com/micro/go-micro/registry/consul"
|
||||||
"github.com/myodc/go-micro/registry/etcd"
|
"github.com/micro/go-micro/registry/etcd"
|
||||||
"github.com/myodc/go-micro/registry/memory"
|
"github.com/micro/go-micro/registry/memory"
|
||||||
|
|
||||||
// transport
|
// transport
|
||||||
thttp "github.com/myodc/go-micro/transport/http"
|
thttp "github.com/micro/go-micro/transport/http"
|
||||||
tnats "github.com/myodc/go-micro/transport/nats"
|
tnats "github.com/micro/go-micro/transport/nats"
|
||||||
trmq "github.com/myodc/go-micro/transport/rabbitmq"
|
trmq "github.com/micro/go-micro/transport/rabbitmq"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -3,10 +3,10 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/myodc/go-micro/client"
|
"github.com/micro/go-micro/client"
|
||||||
"github.com/myodc/go-micro/cmd"
|
"github.com/micro/go-micro/cmd"
|
||||||
c "github.com/myodc/go-micro/context"
|
c "github.com/micro/go-micro/context"
|
||||||
example "github.com/myodc/go-micro/examples/server/proto/example"
|
example "github.com/micro/go-micro/examples/server/proto/example"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
log "github.com/golang/glog"
|
log "github.com/golang/glog"
|
||||||
"github.com/myodc/go-micro/broker"
|
"github.com/micro/go-micro/broker"
|
||||||
"github.com/myodc/go-micro/cmd"
|
"github.com/micro/go-micro/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -2,9 +2,9 @@ package handler
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
log "github.com/golang/glog"
|
log "github.com/golang/glog"
|
||||||
c "github.com/myodc/go-micro/context"
|
c "github.com/micro/go-micro/context"
|
||||||
example "github.com/myodc/go-micro/examples/server/proto/example"
|
example "github.com/micro/go-micro/examples/server/proto/example"
|
||||||
"github.com/myodc/go-micro/server"
|
"github.com/micro/go-micro/server"
|
||||||
|
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
@ -2,10 +2,10 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
log "github.com/golang/glog"
|
log "github.com/golang/glog"
|
||||||
"github.com/myodc/go-micro/cmd"
|
"github.com/micro/go-micro/cmd"
|
||||||
"github.com/myodc/go-micro/examples/server/handler"
|
"github.com/micro/go-micro/examples/server/handler"
|
||||||
"github.com/myodc/go-micro/examples/server/subscriber"
|
"github.com/micro/go-micro/examples/server/subscriber"
|
||||||
"github.com/myodc/go-micro/server"
|
"github.com/micro/go-micro/server"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -2,7 +2,7 @@ package subscriber
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
log "github.com/golang/glog"
|
log "github.com/golang/glog"
|
||||||
example "github.com/myodc/go-micro/examples/server/proto/example"
|
example "github.com/micro/go-micro/examples/server/proto/example"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ package consul
|
|||||||
// This is a hack
|
// This is a hack
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewRegistry(addrs []string, opt ...registry.Option) registry.Registry {
|
func NewRegistry(addrs []string, opt ...registry.Option) registry.Registry {
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
etcd "github.com/coreos/etcd/client"
|
etcd "github.com/coreos/etcd/client"
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ package etcd
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
etcd "github.com/coreos/etcd/client"
|
etcd "github.com/coreos/etcd/client"
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
log "github.com/golang/glog"
|
log "github.com/golang/glog"
|
||||||
"github.com/hashicorp/memberlist"
|
"github.com/hashicorp/memberlist"
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"github.com/pborman/uuid"
|
"github.com/pborman/uuid"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ package memory
|
|||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestDelServices(t *testing.T) {
|
func TestDelServices(t *testing.T) {
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -4,7 +4,7 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Handler interface {
|
type Handler interface {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/myodc/go-micro/server/proto/health"
|
"github.com/micro/go-micro/server/proto/health"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package server
|
package server
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/myodc/go-micro/broker"
|
"github.com/micro/go-micro/broker"
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"github.com/myodc/go-micro/transport"
|
"github.com/micro/go-micro/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type options struct {
|
type options struct {
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
// Code generated by protoc-gen-go.
|
// Code generated by protoc-gen-go.
|
||||||
// source: github.com/myodc/go-micro/proto/health/health.proto
|
// source: github.com/micro/go-micro/proto/health/health.proto
|
||||||
// DO NOT EDIT!
|
// DO NOT EDIT!
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Package health is a generated protocol buffer package.
|
Package health is a generated protocol buffer package.
|
||||||
|
|
||||||
It is generated from these files:
|
It is generated from these files:
|
||||||
github.com/myodc/go-micro/proto/health/health.proto
|
github.com/micro/go-micro/proto/health/health.proto
|
||||||
|
|
||||||
It has these top-level messages:
|
It has these top-level messages:
|
||||||
Request
|
Request
|
||||||
|
@ -3,7 +3,7 @@ package server
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/myodc/go-micro/transport"
|
"github.com/micro/go-micro/transport"
|
||||||
rpc "github.com/youtube/vitess/go/rpcplus"
|
rpc "github.com/youtube/vitess/go/rpcplus"
|
||||||
js "github.com/youtube/vitess/go/rpcplus/jsonrpc"
|
js "github.com/youtube/vitess/go/rpcplus/jsonrpc"
|
||||||
pb "github.com/youtube/vitess/go/rpcplus/pbrpc"
|
pb "github.com/youtube/vitess/go/rpcplus/pbrpc"
|
||||||
|
@ -3,7 +3,7 @@ package server
|
|||||||
import (
|
import (
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
type rpcHandler struct {
|
type rpcHandler struct {
|
||||||
|
@ -6,10 +6,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/myodc/go-micro/broker"
|
"github.com/micro/go-micro/broker"
|
||||||
c "github.com/myodc/go-micro/context"
|
c "github.com/micro/go-micro/context"
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"github.com/myodc/go-micro/transport"
|
"github.com/micro/go-micro/transport"
|
||||||
|
|
||||||
log "github.com/golang/glog"
|
log "github.com/golang/glog"
|
||||||
rpc "github.com/youtube/vitess/go/rpcplus"
|
rpc "github.com/youtube/vitess/go/rpcplus"
|
||||||
|
@ -5,9 +5,9 @@ import (
|
|||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
"github.com/myodc/go-micro/broker"
|
"github.com/micro/go-micro/broker"
|
||||||
c "github.com/myodc/go-micro/context"
|
c "github.com/micro/go-micro/context"
|
||||||
"github.com/myodc/go-micro/registry"
|
"github.com/micro/go-micro/registry"
|
||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ package http
|
|||||||
// This is a hack
|
// This is a hack
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/myodc/go-micro/transport"
|
"github.com/micro/go-micro/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewTransport(addrs []string, opt ...transport.Option) transport.Transport {
|
func NewTransport(addrs []string, opt ...transport.Option) transport.Transport {
|
||||||
|
@ -7,7 +7,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/apcera/nats"
|
"github.com/apcera/nats"
|
||||||
"github.com/myodc/go-micro/transport"
|
"github.com/micro/go-micro/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ntport struct {
|
type ntport struct {
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
uuid "github.com/nu7hatch/gouuid"
|
uuid "github.com/nu7hatch/gouuid"
|
||||||
"github.com/streadway/amqp"
|
"github.com/streadway/amqp"
|
||||||
|
|
||||||
"github.com/myodc/go-micro/transport"
|
"github.com/micro/go-micro/transport"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
Loading…
Reference in New Issue
Block a user