Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Logger hclog.Logger
Functions ¶
This section is empty.
Types ¶
type Dialer ¶
type Dialer interface {
Dial(url string) (WebSocketConn, error)
}
Dialer abstracts WebSocket dialing for testability.
type ListenHandler ¶
type ListenHandler struct {
Name string
Topic string
ChannelType RealtimeChannelType
Table string
Schema string
EventFilter string
ConsumeFn func(ctx context.Context, event string, payload json.RawMessage) error
}
ListenHandler describes a subscription for the provider.
type PhoenixMessage ¶
type PhoenixMessage struct {
Topic string `json:"topic"`
Event string `json:"event"`
Payload json.RawMessage `json:"payload"`
Ref string `json:"ref,omitempty"`
JoinRef string `json:"join_ref,omitempty"`
}
PhoenixMessage is the Phoenix Channels v1 protocol message format.
type Provider ¶
type Provider struct {
Config *ProviderConfig
Dialer Dialer
// contains filtered or unexported fields
}
Provider implements the Supabase Realtime PubSub provider.
func (*Provider) CreateSubscription ¶
CreateSubscription is a no-op for Supabase Realtime (channels are joined on StartListen).
func (*Provider) StartListen ¶
func (p *Provider) StartListen(handlers []ListenHandler) error
StartListen connects to Supabase Realtime, joins channels, and dispatches messages.
func (*Provider) StopListen ¶
StopListen closes the WebSocket connection and stops all listeners.
type ProviderConfig ¶
type ProviderConfig struct {
SupabasePublicUrl string
SupabaseApiUrl string
AnonKey string
ServiceKey string
ProjectId string
}
ProviderConfig holds Supabase connection settings (no raiden imports).
type RealtimeChannelType ¶
type RealtimeChannelType string
RealtimeChannelType mirrors raiden.RealtimeChannelType without importing root.
const ( ChannelBroadcast RealtimeChannelType = "broadcast" ChannelPresence RealtimeChannelType = "presence" ChannelPostgresChanges RealtimeChannelType = "postgres_changes" )
Click to show internal directories.
Click to hide internal directories.