Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow upload URL to be specified for analytics #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/circleci/analytics_clj/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
([write-key]
(initialize write-key nil))

([write-key {:keys [client log endpoint user-agent network-executor callback]}]
([write-key {:keys [client log endpoint upload-url user-agent network-executor callback]}]
(.build (doto (Analytics/builder write-key)
(cond-> (not (nil? client))
(client* client))
Expand All @@ -30,6 +30,9 @@
(cond-> (not (nil? endpoint))
(endpoint* endpoint))

(cond-> (not (nil? upload-url))
(upload-url* upload-url))

(cond-> (not (nil? user-agent))
(user-agent* user-agent))

Expand Down
4 changes: 4 additions & 0 deletions src/circleci/analytics_clj/external.clj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
(doto analytics-builder
(.endpoint endpoint)))

(defn upload-url* [^com.segment.analytics.Analytics$Builder analytics-builder upload-url]
(doto analytics-builder
(.setUploadURL upload-url)))

(defn user-agent* [^com.segment.analytics.Analytics$Builder analytics-builder user-agent]
(doto analytics-builder
(.userAgent user-agent)))
Expand Down