sseconfig

package
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

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

type Option func(*sse.Client)

Option is a function that configures the sse.Client.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient configures the http.Client to be used by the sse.Client.

func WithHeaders

func WithHeaders(headers map[string]string) Option

WithHeaders configures the sse.Client with the provided custom headers.

func WithMaxBufferSize added in v0.5.2

func WithMaxBufferSize(size int) Option

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL