diff --git a/broker/http/http.go b/broker/http/http.go new file mode 100644 index 00000000..770821b5 --- /dev/null +++ b/broker/http/http.go @@ -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...) +} diff --git a/client/rpc/rpc.go b/client/rpc/rpc.go new file mode 100644 index 00000000..5efff382 --- /dev/null +++ b/client/rpc/rpc.go @@ -0,0 +1,9 @@ +package rpc + +import ( + "github.com/micro/go-micro/client" +) + +func NewClient(opts ...client.Option) client.Client { + return client.NewClient(opts...) +} diff --git a/registry/consul/consul.go b/registry/consul/consul.go new file mode 100644 index 00000000..92749e71 --- /dev/null +++ b/registry/consul/consul.go @@ -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...) +} diff --git a/server/rpc/rpc.go b/server/rpc/rpc.go new file mode 100644 index 00000000..98e1de1c --- /dev/null +++ b/server/rpc/rpc.go @@ -0,0 +1,9 @@ +package rpc + +import ( + "github.com/micro/go-micro/server" +) + +func NewServer(opts ...server.Option) server.Server { + return server.NewServer(opts...) +} diff --git a/transport/http/http.go b/transport/http/http.go new file mode 100644 index 00000000..16cdc102 --- /dev/null +++ b/transport/http/http.go @@ -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...) +}