Added Nodes method to Network interface
This commit is contained in:
@@ -21,14 +21,16 @@ var (
|
||||
|
||||
// Network is micro network
|
||||
type Network interface {
|
||||
// Node is network node
|
||||
Node
|
||||
// Options returns the network options
|
||||
Options() Options
|
||||
// Name of the network
|
||||
Name() string
|
||||
// Address returns network bind address
|
||||
Address() string
|
||||
// Connect starts the resolver and tunnel server
|
||||
Connect() error
|
||||
// Nodes returns list of network nodes
|
||||
Nodes() []Node
|
||||
// Close stops the tunnel and resolving
|
||||
Close() error
|
||||
// Client is micro client
|
||||
@@ -37,6 +39,16 @@ type Network interface {
|
||||
Server() server.Server
|
||||
}
|
||||
|
||||
// Node is network node
|
||||
type Node interface {
|
||||
// Id is node id
|
||||
Id() string
|
||||
// Address is node bind address
|
||||
Address() string
|
||||
// Network is the network node is in
|
||||
Network() Network
|
||||
}
|
||||
|
||||
// NewNetwork returns a new network interface
|
||||
func NewNetwork(opts ...Option) Network {
|
||||
return newNetwork(opts...)
|
||||
|
Reference in New Issue
Block a user