sse

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Msg

type Msg[T any] struct {
	Type MsgType `json:"type"`
	Data T       `json:"data"`
}

func (Msg[T]) WriteTry

func (msg Msg[T]) WriteTry(w StreamWriter)

type MsgType

type MsgType string
const (
	MsgInit  MsgType = "init"
	MsgDanmu MsgType = "danmu"
)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(key, secret string, appid int64) *Server

func (*Server) BatchKeepAlive

func (srv *Server) BatchKeepAlive(ctx context.Context)

func (*Server) ServeHTTP

func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

type StreamWriter

type StreamWriter struct {
	http.Flusher
	io.Writer
}

Jump to

Keyboard shortcuts

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