Merge pull request #56 from micro/defaults
Add packages for the defaults
This commit is contained in:
		
							
								
								
									
										14
									
								
								broker/http/http.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								broker/http/http.go
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										9
									
								
								client/rpc/rpc.go
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										14
									
								
								registry/consul/consul.go
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										9
									
								
								server/rpc/rpc.go
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										14
									
								
								transport/http/http.go
									
									
									
									
									
										Normal 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...) | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user