From f3ae68b9f28e0ddbe33be3ecf09c2015cfba6078 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Fri, 29 Jul 2016 08:28:28 +0000 Subject: config: curve out code specific to default global config setting Signed-off-by: ISHIDA Wataru --- docs/sources/lib.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'docs/sources/lib.md') diff --git a/docs/sources/lib.md b/docs/sources/lib.md index 7688e71f..ad1e257c 100644 --- a/docs/sources/lib.md +++ b/docs/sources/lib.md @@ -32,21 +32,19 @@ func main() { go g.Serve() // global configuration - b := &config.BgpConfigSet{ - Global: config.Global{ - Config: config.GlobalConfig{ - As: 65000, - RouterId: "10.0.255.254", - Port: -1, // gobgp won't listen on tcp:179 - }, + global := &config.Global{ + Config: config.GlobalConfig{ + As: 65000, + RouterId: "10.0.255.254", + Port: -1, // gobgp won't listen on tcp:179 }, } - if err := config.SetDefaultConfigValues(b); err != nil { + if err := config.SetDefaultGlobalConfigValues(global); err != nil { log.Fatal(err) } - if err := s.Start(&b.Global); err != nil { + if err := s.Start(global); err != nil { log.Fatal(err) } @@ -58,7 +56,7 @@ func main() { }, } - if err := config.SetDefaultNeighborConfigValues(n, b.Global.Config.As); err != nil { + if err := config.SetDefaultNeighborConfigValues(n, global.Config.As); err != nil { log.Fatal(err) } -- cgit v1.2.3