Rough outline of Network introspection interface

This commit is contained in:
Milos Gajdos
2019-09-02 11:42:45 +01:00
parent 6c3631728b
commit bf53c16e4b
6 changed files with 255 additions and 38 deletions

View File

@@ -52,7 +52,7 @@ type network struct {
// client is network client
client client.Client
// tunClient is a mao of tunnel clients keyed over channel names
// tunClient is a map of tunnel clients keyed over tunnel channel names
tunClient map[string]transport.Client
sync.RWMutex
@@ -118,6 +118,15 @@ func newNetwork(opts ...Option) Network {
}
}
// Options returns network options
func (n *network) Options() Options {
n.Lock()
options := n.options
n.Unlock()
return options
}
// Name returns network name
func (n *network) Name() string {
return n.options.Name