From c342d7a5b06464afd7061fe592323e7744b1d181 Mon Sep 17 00:00:00 2001 From: Matthias Hannig Date: Fri, 3 Aug 2018 14:38:32 +0200 Subject: [PATCH] add config option for on demand noexport loading --- backend/api.go | 5 +++-- backend/api/response.go | 5 +++-- backend/config.go | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/backend/api.go b/backend/api.go index 016a751..f3bc13c 100644 --- a/backend/api.go +++ b/backend/api.go @@ -129,8 +129,9 @@ func apiConfigShow(_req *http.Request, _params httprouter.Params) (api.Response, RejectReasons: SerializeReasons( AliceConfig.Ui.RoutesRejections.Reasons), Noexport: api.Noexport{ - Asn: AliceConfig.Ui.RoutesNoexports.Asn, - NoexportId: AliceConfig.Ui.RoutesNoexports.NoexportId, + Asn: AliceConfig.Ui.RoutesNoexports.Asn, + NoexportId: AliceConfig.Ui.RoutesNoexports.NoexportId, + LoadOnDemand: AliceConfig.Ui.RoutesNoexports.LoadOnDemand, }, NoexportReasons: SerializeReasons( AliceConfig.Ui.RoutesNoexports.Reasons), diff --git a/backend/api/response.go b/backend/api/response.go index a285a93..3b553ec 100644 --- a/backend/api/response.go +++ b/backend/api/response.go @@ -46,8 +46,9 @@ type Rejection struct { } type Noexport struct { - Asn int `json:"asn"` - NoexportId int `json:"noexport_id"` + Asn int `json:"asn"` + NoexportId int `json:"noexport_id"` + LoadOnDemand bool `json:"load_on_demand"` } // Status diff --git a/backend/config.go b/backend/config.go index b1d1763..308e4aa 100644 --- a/backend/config.go +++ b/backend/config.go @@ -35,6 +35,8 @@ type NoexportsConfig struct { NoexportId int `ini:"noexport_id"` Reasons map[int]string + + LoadOnDemand bool } type UiConfig struct {