From 57eecf610278462166cf4ece15a63b17ab6fc5b4 Mon Sep 17 00:00:00 2001 From: joshemb <josh@elixxir.io> Date: Thu, 8 Sep 2022 10:17:00 -0700 Subject: [PATCH] Add a SetDashboardURL --- bindings/delivery.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bindings/delivery.go b/bindings/delivery.go index 2cdb16b94..6420196d4 100644 --- a/bindings/delivery.go +++ b/bindings/delivery.go @@ -20,7 +20,20 @@ import ( // dashboardBaseURL is the base of the xx network's round dashboard URL. // This should be used by any type of send report's GetRoundURL method. -const dashboardBaseURL = "https://dashboard.xx.network" +var dashboardBaseURL = "https://dashboard.xx.network" + +// SetDashboardURL is a function which modifies the base dashboard URL +// that is returned as part of any send report. Internally, this is defaulted +// to "https://dashboard.xx.network". This should only be called if the user +// explicitly wants to modify the dashboard URL. This function is not +// thread-safe, and as such should only be called on setup. +// +// Parameters: +// - newURL - A valid URL that will be used for round look up on any send +// report. +func SetDashboardURL(newURL string) { + dashboardBaseURL = newURL +} // getRoundURL is a helper function which returns the specific round // within any type of send report, if they have a round in their RoundsList. -- GitLab