From cd09f937816a167c6f588767c22cc800f15c2382 Mon Sep 17 00:00:00 2001 From: Karolis Rusenas Date: Sun, 15 Nov 2020 20:50:13 +0000 Subject: [PATCH] option for base url --- options.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/options.go b/options.go index 0b36a90..2ec9b21 100644 --- a/options.go +++ b/options.go @@ -16,6 +16,15 @@ func WithHTTPClient(client *http.Client) Option { } } +// WithAPIEndpointURL overrides default Webhook Relay API server address. +// Default: "https://my.webhookrelay.com/v1" +func WithAPIEndpointURL(apiBaseURL string) Option { + return func(api *API) error { + api.BaseURL = apiBaseURL + return nil + } +} + // WithHeaders allows you to set custom HTTP headers when making API calls (e.g. for // satisfying HTTP proxies, or for debugging). func WithHeaders(headers http.Header) Option {