Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultWebsocketPingInterval = 25 * time.Second DefaultWebsocketMessageSizeLimit = 1024 * 1024 // 1MB )
Defaults.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// ReadBufferSize is a parameter that is used for raw websocket Upgrader.
// If set to zero reasonable default value will be used.
ReadBufferSize int
// WriteBufferSize is a parameter that is used for raw websocket Upgrader.
// If set to zero reasonable default value will be used.
WriteBufferSize int
// MessageSizeLimit sets the maximum size in bytes of allowed message from client.
// By default DefaultWebsocketMessageSizeLimit will be used.
MessageSizeLimit int
// CheckOrigin func to provide custom origin check logic,
// zero value means same host check.
CheckOrigin func(r *http.Request) bool
// PingInterval sets interval server will send ping messages to clients.
// By default DefaultWebsocketPingInterval will be used.
PingInterval time.Duration
}
Config represents config for Handler.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler handles WebSocket client connections that push data to Live.
func NewHandler ¶
func NewHandler(managedStreamRunner *managedstream.Runner, c Config) *Handler
NewHandler creates new Handler.
type PipelinePushHandler ¶
type PipelinePushHandler struct {
// contains filtered or unexported fields
}
PipelinePushHandler handles WebSocket client connections that push data to Live Pipeline.
func NewPipelinePushHandler ¶
func NewPipelinePushHandler(pipeline *pipeline.Pipeline, c Config) *PipelinePushHandler
NewPathHandler creates new PipelinePushHandler.
func (*PipelinePushHandler) ServeHTTP ¶
func (s *PipelinePushHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.