Documentation
¶
Overview ¶
The github.com/r3labs/sse/v2 package provides an interface for creating clients that takes options but doesn't implement any of the options. This file implements the options for the github.com/r3labs/sse/v2 package so it can be configured with the idiomatic With*Option pattern.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
Option is a function that configures the sse.Client.
func WithHTTPClient ¶
WithHTTPClient configures the http.Client to be used by the sse.Client.
func WithHeaders ¶
WithHeaders configures the sse.Client with the provided custom headers.
func WithMaxBufferSize ¶ added in v0.5.2
WithMaxBufferSize configures the largest single event the sse.Client will read.
The library reads events with a bufio.Scanner and defaults the limit to 64KB. An event larger than the limit stops the read with no further events delivered, so the caller waits out its stream timeout on a stream the server has already finished. A change set for a large blueprint passes 64KB easily.
func WithResponseValidator ¶
func WithResponseValidator( responseValidator sse.ResponseValidator, ) Option
WithResponseValidator configures the sse.Client with the provided response validator. The response validator is used to validate the response from the server in order to handle non-200 status codes and other errors.