dvssews

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REQUEST_SSE_COUNTER = "REQUEST_SSE_COUNTER"
	REQUEST_SSE_INDEX   = "REQUEST_SSE_INDEX"
	REQUEST_SSE_EVENT   = "REQUEST_SSE_EVENT"
)

Variables

View Source
var (
	SSELineEnd      = []byte("\n")
	SSELineFullEnd  = []byte("\n\n")
	SSEIdPrefix     = []byte("id: ")
	SSEHeartBeat    = []byte(": heartbeat\n\n")
	SSEEventPrefix  = []byte("event: ")
	SSEEventDefault = []byte("message")
	SSEDataPrefix   = []byte("data: ")
)
View Source
var SseHeaders = map[string]string{
	"Access-Control-Allow-Origin": "*",
	"Content-Type":                "text/event-stream",
	"Cache-Control":               "no-cache",
	"Connection":                  "keep-alive",
	"Transfer-Encoding":           "chunked",
}

Functions

func RunInSSEWSContext

func RunInSSEWSContext(ctx *dvcontext.RequestContext, parallelMode int)

func SSEMessageBytes

func SSEMessageBytes(ctx *dvcontext.RequestContext, id []byte, event []byte, data []byte)

func SSEMessageInterface

func SSEMessageInterface(ctx *dvcontext.RequestContext, v interface{})

func SSEMessageString

func SSEMessageString(ctx *dvcontext.RequestContext, s string)

func SSESendHeartBeat

func SSESendHeartBeat(ctx *dvcontext.RequestContext)

func SSESendPortion

func SSESendPortion(ctx *dvcontext.RequestContext, data []byte)

func SetParallelProcessingParameters

func SetParallelProcessingParameters(params *dvcontext.ParallelProcessing)

func SetTimeUnitInSeconds

func SetTimeUnitInSeconds(unitTime float32)

Types

This section is empty.

Jump to

Keyboard shortcuts

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