diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-10-27 20:48:18 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2018-10-28 21:25:49 +0900 |
commit | d032c3153e72ab3c01355a20098ac1b68d26cba5 (patch) | |
tree | 5123a1b7a2d1af5a7d95476efae028df0b6da535 /cmd/gobgpd | |
parent | 23ae91cfc1a541b7033126c284e9a2e5814836ca (diff) |
move exported functions to generate api structs from config struct in server/
NewPeerFromConfigStruct()
NewPeerGroupFromConfigStruct()
NewGlobalFromConfigStruct()
The config is an internal package so they should not be exported.
We will remove the usage of the config in server/. This is a part of
the goal.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'cmd/gobgpd')
-rw-r--r-- | cmd/gobgpd/main.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd/gobgpd/main.go b/cmd/gobgpd/main.go index c212562c..4bff160f 100644 --- a/cmd/gobgpd/main.go +++ b/cmd/gobgpd/main.go @@ -185,7 +185,7 @@ func main() { if c == nil { c = newConfig if _, err := apiServer.StartBgp(context.Background(), &api.StartBgpRequest{ - Global: server.NewGlobalFromConfigStruct(&c.Global), + Global: config.NewGlobalFromConfigStruct(&c.Global), }); err != nil { log.Fatalf("failed to set global config: %s", err) } @@ -360,7 +360,7 @@ func main() { for _, pg := range addedPg { log.Infof("PeerGroup %s is added", pg.Config.PeerGroupName) if _, err := apiServer.AddPeerGroup(context.Background(), &api.AddPeerGroupRequest{ - PeerGroup: server.NewPeerGroupFromConfigStruct(&pg), + PeerGroup: config.NewPeerGroupFromConfigStruct(&pg), }); err != nil { log.Warn(err) } @@ -376,7 +376,7 @@ func main() { for _, pg := range updatedPg { log.Infof("PeerGroup %v is updated", pg.State.PeerGroupName) if u, err := apiServer.UpdatePeerGroup(context.Background(), &api.UpdatePeerGroupRequest{ - PeerGroup: server.NewPeerGroupFromConfigStruct(&pg), + PeerGroup: config.NewPeerGroupFromConfigStruct(&pg), }); err != nil { log.Warn(err) } else { @@ -386,7 +386,7 @@ func main() { for _, pg := range updatedPg { log.Infof("PeerGroup %s is updated", pg.Config.PeerGroupName) if _, err := apiServer.UpdatePeerGroup(context.Background(), &api.UpdatePeerGroupRequest{ - PeerGroup: server.NewPeerGroupFromConfigStruct(&pg), + PeerGroup: config.NewPeerGroupFromConfigStruct(&pg), }); err != nil { log.Warn(err) } @@ -405,7 +405,7 @@ func main() { for _, p := range added { log.Infof("Peer %v is added", p.State.NeighborAddress) if _, err := apiServer.AddPeer(context.Background(), &api.AddPeerRequest{ - Peer: server.NewPeerFromConfigStruct(&p), + Peer: config.NewPeerFromConfigStruct(&p), }); err != nil { log.Warn(err) } @@ -421,7 +421,7 @@ func main() { for _, p := range updated { log.Infof("Peer %v is updated", p.State.NeighborAddress) if u, err := apiServer.UpdatePeer(context.Background(), &api.UpdatePeerRequest{ - Peer: server.NewPeerFromConfigStruct(&p), + Peer: config.NewPeerFromConfigStruct(&p), }); err != nil { log.Warn(err) } else { |