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

updated note part of the Webhook Accept field #73

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
11 changes: 8 additions & 3 deletions webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,14 @@ type DNSSrvRecord struct {
type Webhook struct {
// Accept is the encoding type of outgoing events. The following encoding types are supported, otherwise
// a 406 response code is returned: application/octet-stream, application/json, application/jsonl, application/msgpack.
// Note: An `Accept` of application/octet-stream or application/json will result in a single response for batch sizes of 0 or 1
// and batch sizes greater than 1 will result in a multipart response. An `Accept` of application/jsonl or application/msgpack
// will always result in a single response with a list of batched events for any batch size.
/*
Note:
An `Accept` of application/octet-stream supports single message return with payload of WRP
An `Accept` of application/json supports single message return with json form of WRP
Comment on lines +104 to +105
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds like batching will only be available for application/jsonl and application/msgpack, that works 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spoke to John about this & he suggested this set of values for better clarity:
application/wrp+json - one json encoded wrp message
application/wrp+msgpack - one msgpack encoded wrp message
application/wrp+octet-stream - one message with the wrp payload in the http payload
application/wrp+jsonl - multiple jsonl encoded wrp messages
application/wrp+msgpackl - multiple msgpackl encoded wrp messages

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! I really like this idea

An `Accept` of application/jsonl supports single or multi records with each line being independent json encoding of a WRP
An `Accept` of application/msgpack supports single or multi records with a single record being of msgpack and multiple records being
returned as an array of binary data with the binary data being the msgpacked WRP for each message
*/
Accept string `json:"accept"`

// AcceptEncoding is the content type of outgoing events. The following content types are supported, otherwise
Expand Down