Add packages for the defaults

This commit is contained in:
Asim 2016-03-14 10:45:38 +00:00
parent c0b25e7a65
commit 71764564e7
5 changed files with 60 additions and 0 deletions

14
broker/http/http.go Normal file
View File

@ -0,0 +1,14 @@
package http
import (
"github.com/micro/go-micro/broker"
"github.com/micro/go-micro/cmd"
)
func init() {
cmd.DefaultBrokers["http"] = NewBroker
}
func NewBroker(addrs []string, opts ...broker.Option) broker.Broker {
return broker.NewBroker(addrs, opts...)
}

9
client/rpc/rpc.go Normal file
View File

@ -0,0 +1,9 @@
package rpc
import (
"github.com/micro/go-micro/client"
)
func NewClient(opts ...client.Option) client.Client {
return client.NewClient(opts...)
}

14
registry/consul/consul.go Normal file
View File

@ -0,0 +1,14 @@
package consul
import (
"github.com/micro/go-micro/cmd"
"github.com/micro/go-micro/registry"
)
func init() {
cmd.DefaultRegistries["consul"] = NewRegistry
}
func NewRegistry(addrs []string, opts ...registry.Option) registry.Registry {
return registry.NewRegistry(addrs, opts...)
}

9
server/rpc/rpc.go Normal file
View File

@ -0,0 +1,9 @@
package rpc
import (
"github.com/micro/go-micro/server"
)
func NewServer(opts ...server.Option) server.Server {
return server.NewServer(opts...)
}

14
transport/http/http.go Normal file
View File

@ -0,0 +1,14 @@
package http
import (
"github.com/micro/go-micro/cmd"
"github.com/micro/go-micro/transport"
)
func init() {
cmd.DefaultTransports["http"] = NewTransport
}
func NewTransport(addrs []string, opts ...transport.Option) transport.Transport {
return transport.NewTransport(addrs, opts...)
}