mojocn / sseread

A tidy library seamlessly reads Server-Sent Events (SSE) from the response body of Go's standard HTTP package.

Home Page:https://pkg.go.dev/github.com/mojocn/sseread#pkg-index

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Server Sent Events Reader

GoDoc Go Report Card codecov Go version Follow mojocn

This is a straightforward library illustrating the method to read Server Sent Events (SSE) stream from the Response.Body in Golang.

Usage

download the library using go get -u github.com/mojocn/sseread@latest

simple examples of how to use the library.

  1. read SSE by callback
  2. read SSE by channel
  3. cloudflare AI text generation example

Testing

# git clone https://github.com/mojocn/sseread.git && cd sseread
go test -v

About

A tidy library seamlessly reads Server-Sent Events (SSE) from the response body of Go's standard HTTP package.

https://pkg.go.dev/github.com/mojocn/sseread#pkg-index

License:Apache License 2.0


Languages

Language:Go 100.0%