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

notifier: Allow swapping out HTTP Doer #2452

Merged
merged 1 commit into from
Feb 27, 2017
Merged

notifier: Allow swapping out HTTP Doer #2452

merged 1 commit into from
Feb 27, 2017

Conversation

juliusv
Copy link
Member

@juliusv juliusv commented Feb 27, 2017

We need to be able to modify the HTTP POST in Weave Cortex to add
multitenancy information to a notification. Since we only really need a
special header in the end, the other option would be to just allow
passing in headers to the notifier. But swapping out the whole Doer is
more general and allows others to swap out the network-talky bits of the
notifier for their own use. Doing this via contexts here wouldn't work
well, due to the decoupled flow of data in the notifier.

There was no existing interface containing the ctxhttp.Post() or
ctxhttp.Do() methods, so I settled on just using Do() as a swappable
function directly (and with a more minimal signature than Post).

We need to be able to modify the HTTP POST in Weave Cortex to add
multitenancy information to a notification. Since we only really need a
special header in the end, the other option would be to just allow
passing in headers to the notifier. But swapping out the whole Doer is
more general and allows others to swap out the network-talky bits of the
notifier for their own use. Doing this via contexts here wouldn't work
well, due to the decoupled flow of data in the notifier.

There was no existing interface containing the ctxhttp.Post() or
ctxhttp.Do() methods, so I settled on just using Do() as a swappable
function directly (and with a more minimal signature than Post).
@juliusv
Copy link
Member Author

juliusv commented Feb 27, 2017

@fabxc Saw you are listed as the maintainer of this bit now ;)

@fabxc
Copy link
Contributor

fabxc commented Feb 27, 2017

👍

@juliusv juliusv merged commit 07491c9 into master Feb 27, 2017
@juliusv juliusv deleted the swappable-post branch February 27, 2017 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants