Implementation of Nodes method. First take on full handler
This commit is contained in:
@@ -19,6 +19,18 @@ var (
|
||||
AnnounceTime = 30 * time.Second
|
||||
)
|
||||
|
||||
// Node is network node
|
||||
type Node interface {
|
||||
// Id is node id
|
||||
Id() string
|
||||
// Address is node bind address
|
||||
Address() string
|
||||
// Neighbourhood is node neighbourhood
|
||||
Neighbourhood() []Node
|
||||
// Network is the network node is in
|
||||
Network() Network
|
||||
}
|
||||
|
||||
// Network is micro network
|
||||
type Network interface {
|
||||
// Node is network node
|
||||
@@ -39,16 +51,6 @@ 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