1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-06-18 22:17:44 +02:00

add Network.Init method

This commit is contained in:
Asim Aslam
2019-10-13 12:38:13 +01:00
parent 174f1b857c
commit 01492997ea
2 changed files with 14 additions and 0 deletions

View File

@ -144,6 +144,18 @@ func newNetwork(opts ...Option) Network {
return network
}
func (n *network) Init(opts ...Option) error {
n.Lock()
defer n.Unlock()
// TODO: maybe only allow reinit of certain opts
for _, o := range opts {
o(&n.options)
}
return nil
}
// Options returns network options
func (n *network) Options() Options {
n.RLock()