syntactic changes
This commit is contained in:
parent
47acdf6a4b
commit
8855beb62d
@ -5,13 +5,6 @@ import (
|
|||||||
"github.com/micro/go-micro/registry"
|
"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
|
// Options are router options
|
||||||
type Options struct {
|
type Options struct {
|
||||||
// Id is router id
|
// Id is router id
|
||||||
|
@ -5,13 +5,6 @@ import (
|
|||||||
"time"
|
"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
|
// Router is an interface for a routing control plane
|
||||||
type Router interface {
|
type Router interface {
|
||||||
// Init initializes the router with options
|
// Init initializes the router with options
|
||||||
@ -110,6 +103,17 @@ type Advert struct {
|
|||||||
Events []*Event
|
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
|
// NewRouter creates new Router and returns it
|
||||||
func NewRouter(opts ...Option) Router {
|
func NewRouter(opts ...Option) Router {
|
||||||
return newRouter(opts...)
|
return newRouter(opts...)
|
||||||
|
@ -6,11 +6,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
// ErrWatcherStopped is returned when routing table watcher has been stopped
|
|
||||||
ErrWatcherStopped = errors.New("watcher stopped")
|
|
||||||
)
|
|
||||||
|
|
||||||
// EventType defines routing table event
|
// EventType defines routing table event
|
||||||
type EventType int
|
type EventType int
|
||||||
|
|
||||||
@ -118,7 +113,7 @@ func (w *tableWatcher) Stop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// String prints debug information
|
var (
|
||||||
func (w tableWatcher) String() string {
|
// ErrWatcherStopped is returned when routing table watcher has been stopped
|
||||||
return "watcher"
|
ErrWatcherStopped = errors.New("watcher stopped")
|
||||||
}
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user