Documentation ¶
Index ¶
- Constants
- type Listener
- type Notifier
- type Payload
- type PromNotifier
- type PubSub
- type V2AccountData
- type V2Accumulate
- type V2DeviceData
- type V2DeviceMessages
- type V2ExpiredToken
- type V2InitialSyncComplete
- type V2Initialise
- type V2InvalidateRoom
- type V2InviteRoom
- type V2LeaveRoom
- type V2Listener
- type V2Receipt
- type V2StateRedaction
- type V2Sub
- type V2TransactionID
- type V2Typing
- type V2UnreadCounts
- type V3EnsurePolling
- type V3Listener
- type V3Sub
Constants ¶
const ChanV2 = "v2ch"
The channel which has V2* payloads
const ChanV3 = "v3ch"
The channel which has V3* payloads
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Listener ¶
type Listener interface { // Begin listening on this channel with this callback starting from this position. Blocks until Close() is called. Listen(chanName string, fn func(p Payload)) error // Close the listener. No more callbacks should fire. Close() error }
Listener represents the common functions required by all subscription listeners
type Notifier ¶
type Notifier interface { // Notify chanName that there is a new payload p. Return an error if we failed to send the notification. Notify(chanName string, p Payload) error // Close is called when we should stop listening. Close() error }
Notifier represents the common functions required by all notifiers
func NewPromNotifier ¶
Wrap a notifier for prometheus metrics
type Payload ¶
type Payload interface { // The type of payload; used mostly for logging and prometheus metrics Type() string }
type PromNotifier ¶
type PromNotifier struct { Notifier // contains filtered or unexported fields }
Wrapper around a Notifier which adds Prometheus metrics
func (*PromNotifier) Close ¶
func (p *PromNotifier) Close() error
type V2AccountData ¶
func (*V2AccountData) Type ¶
func (*V2AccountData) Type() string
type V2Accumulate ¶
func (*V2Accumulate) Type ¶
func (*V2Accumulate) Type() string
type V2DeviceData ¶
func (*V2DeviceData) Type ¶
func (*V2DeviceData) Type() string
type V2DeviceMessages ¶ added in v0.98.1
func (*V2DeviceMessages) Type ¶ added in v0.98.1
func (*V2DeviceMessages) Type() string
type V2ExpiredToken ¶ added in v0.99.2
func (*V2ExpiredToken) Type ¶ added in v0.99.2
func (*V2ExpiredToken) Type() string
type V2InitialSyncComplete ¶
func (*V2InitialSyncComplete) Type ¶
func (*V2InitialSyncComplete) Type() string
type V2Initialise ¶
func (*V2Initialise) Type ¶
func (*V2Initialise) Type() string
type V2InvalidateRoom ¶ added in v0.99.11
type V2InvalidateRoom struct {
RoomID string
}
V2InvalidateRoom is emitted after a non-incremental state change to a room, in place of a V2Initialise payload.
func (*V2InvalidateRoom) Type ¶ added in v0.99.11
func (*V2InvalidateRoom) Type() string
type V2InviteRoom ¶
func (*V2InviteRoom) Type ¶
func (*V2InviteRoom) Type() string
type V2LeaveRoom ¶
type V2LeaveRoom struct { UserID string RoomID string LeaveEvent json.RawMessage }
func (*V2LeaveRoom) Type ¶
func (*V2LeaveRoom) Type() string
type V2Listener ¶
type V2Listener interface { Initialise(p *V2Initialise) Accumulate(p *V2Accumulate) OnTransactionID(p *V2TransactionID) OnAccountData(p *V2AccountData) OnInvite(p *V2InviteRoom) OnLeftRoom(p *V2LeaveRoom) OnUnreadCounts(p *V2UnreadCounts) OnInitialSyncComplete(p *V2InitialSyncComplete) OnDeviceData(p *V2DeviceData) OnTyping(p *V2Typing) OnReceipt(p *V2Receipt) OnDeviceMessages(p *V2DeviceMessages) OnExpiredToken(p *V2ExpiredToken) OnInvalidateRoom(p *V2InvalidateRoom) OnStateRedaction(p *V2StateRedaction) }
V2Listener describes the messages that sync v2 pollers will publish.
type V2StateRedaction ¶ added in v0.99.12
type V2StateRedaction struct {
RoomID string
}
V2StateRedaction is emitted when a timeline is seen that contains one or more redaction events targeting a piece of room state. The redaction will be emitted before its corresponding V2Accumulate payload is emitted.
func (*V2StateRedaction) Type ¶ added in v0.99.12
func (*V2StateRedaction) Type() string
type V2Sub ¶
type V2Sub struct {
// contains filtered or unexported fields
}
func NewV2Sub ¶
func NewV2Sub(l Listener, recv V2Listener) *V2Sub
type V2TransactionID ¶ added in v0.99.3
type V2TransactionID struct { EventID string RoomID string UserID string // of the sender DeviceID string TransactionID string // Note: an empty transaction ID represents the all-clear. NID int64 }
V2TransactionID is emitted by a poller when it sees an event with a transaction ID, or when it is certain that no other poller will see a transaction ID for this event (the "all-clear").
func (*V2TransactionID) Type ¶ added in v0.99.3
func (*V2TransactionID) Type() string
type V2Typing ¶
type V2Typing struct { RoomID string EphemeralEvent json.RawMessage }
type V2UnreadCounts ¶
type V2UnreadCounts struct { UserID string RoomID string HighlightCount *int NotificationCount *int }
func (*V2UnreadCounts) Type ¶
func (*V2UnreadCounts) Type() string
type V3EnsurePolling ¶
type V3EnsurePolling struct { // TODO: we only really need to provide the access token hash here. // Passing through a user means we can log something sensible though. UserID string DeviceID string AccessTokenHash string }
func (*V3EnsurePolling) Type ¶
func (*V3EnsurePolling) Type() string
type V3Listener ¶
type V3Listener interface {
EnsurePolling(p *V3EnsurePolling)
}
V3Listener describes the messages that incoming sliding sync requests will publish.