Documentation
¶
Overview ¶
Package broadcast captures events an app sends to a Pusher-compatible server (Laravel Reverb, Pusher, soketi) over the Pusher HTTP API: POST /apps/{app_id}/events and /batch_events. Point the app's REVERB_HOST / PUSHER_HOST at Buggregator; each event becomes a card with its channels and data. With an upstream set, the same request also goes to the real server, so browsers still get the events.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Upstream is the real Pusher-compatible server (e.g. http://127.0.0.1:8080
// for Reverb). Empty: capture only, the app gets {} back.
Upstream string
// Secrets maps an app key to its secret, to check request signatures.
// A key with no secret is not checked.
Secrets map[string]string
// Timeout bounds a forward; default 5 s.
Timeout time.Duration
}
Config is the module's settings.
type Event ¶
type Event struct {
AppID string `json:"app_id"`
Name string `json:"name"`
Channels []string `json:"channels"`
Kinds []string `json:"channel_kinds"` // per channel: public, private, presence, encrypted, user
Data string `json:"data"` // as sent: a string, JSON in most apps
DataJSON json.RawMessage `json:"data_json,omitempty"`
Encrypted bool `json:"encrypted,omitempty"` // private-encrypted-*: data is ciphertext
SocketID string `json:"socket_id,omitempty"` // sent to everyone but this socket (toOthers)
Info string `json:"info,omitempty"`
AuthKey string `json:"auth_key,omitempty"`
Signature string `json:"signature"` // valid, invalid or not_checked
Size int `json:"size"` // bytes of data
Warnings []string `json:"warnings"`
Library string `json:"library,omitempty"` // X-Pusher-Library
BatchID string `json:"batch_id,omitempty"`
BatchSize int `json:"batch_size,omitempty"`
Upstream *Upstream `json:"upstream,omitempty"`
}
Event is one stored broadcast event.
type EventStorer ¶
EventStorer stores one event: a batch request makes several.
type Module ¶
type Module struct {
module.BaseModule
// contains filtered or unexported fields
}
Module is the broadcast events catcher.
func (*Module) HTTPHandler ¶
func (m *Module) HTTPHandler() module.HTTPIngestionHandler
func (*Module) PreviewMapper ¶
func (m *Module) PreviewMapper() event.PreviewMapper
func (*Module) SetEventService ¶
func (m *Module) SetEventService(es EventStorer)
SetEventService sets where the events go.