syntactic changes

This commit is contained in:
Asim Aslam 2019-07-29 12:43:20 +01:00
parent 47acdf6a4b
commit 8855beb62d
3 changed files with 15 additions and 23 deletions

View File

@ -5,13 +5,6 @@ import (
"github.com/micro/go-micro/registry"
)
var (
// DefaultAddress is default router address
DefaultAddress = ":9093"
// DefaultNetwork is default micro network
DefaultNetwork = "go.micro"
)
// Options are router options
type Options struct {
// Id is router id

View File

@ -5,13 +5,6 @@ import (
"time"
)
var (
// DefaultRouter is default network router
DefaultRouter = NewRouter()
// DefaultName is default router service name
DefaultName = "go.micro.router"
)
// Router is an interface for a routing control plane
type Router interface {
// Init initializes the router with options
@ -110,6 +103,17 @@ type Advert struct {
Events []*Event
}
var (
// DefaultAddress is default router address
DefaultAddress = ":9093"
// DefaultName is default router service name
DefaultName = "go.micro.router"
// DefaultNetwork is default micro network
DefaultNetwork = "go.micro"
// DefaultRouter is default network router
DefaultRouter = NewRouter()
)
// NewRouter creates new Router and returns it
func NewRouter(opts ...Option) Router {
return newRouter(opts...)

View File

@ -6,11 +6,6 @@ import (
"time"
)
var (
// ErrWatcherStopped is returned when routing table watcher has been stopped
ErrWatcherStopped = errors.New("watcher stopped")
)
// EventType defines routing table event
type EventType int
@ -118,7 +113,7 @@ func (w *tableWatcher) Stop() {
}
}
// String prints debug information
func (w tableWatcher) String() string {
return "watcher"
}
var (
// ErrWatcherStopped is returned when routing table watcher has been stopped
ErrWatcherStopped = errors.New("watcher stopped")
)