Documentation
¶
Index ¶
- type Registry
- func (r *Registry) AddEvents(sync *api.SyncResponse) error
- func (r *Registry) OnSync(f func(*api.SyncResponse)) func()
- func (r *Registry) OnSyncCh(ctx context.Context, ch chan<- *api.SyncResponse)
- func (r *Registry) SubscribeAllTimeline(f interface{}) func()
- func (r *Registry) SubscribeRoom(rID matrix.RoomID, typ event.Type, f interface{}) func()
- func (r *Registry) SubscribeRoomEvents(rID matrix.RoomID, types []event.Type, f interface{}) func()
- func (r *Registry) SubscribeRoomStateKey(rID matrix.RoomID, typ event.Type, key string, f interface{}) func()
- func (r *Registry) SubscribeRoomSync(rID matrix.RoomID, f func()) func()
- func (r *Registry) SubscribeTimeline(rID matrix.RoomID, f interface{}) func()
- func (r *Registry) SubscribeTimelineSync(rID matrix.RoomID, f interface{}) func()
- func (r *Registry) SubscribeUser(typ event.Type, f interface{}) func()
- func (r *Registry) Wrap(state gotrix.State) gotrix.State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func (*Registry) AddEvents ¶
func (r *Registry) AddEvents(sync *api.SyncResponse) error
AddEvents satisfies part of gotrix.State.
func (*Registry) OnSync ¶
func (r *Registry) OnSync(f func(*api.SyncResponse)) func()
OnSync is called after the state updates on every sync.
func (*Registry) OnSyncCh ¶
func (r *Registry) OnSyncCh(ctx context.Context, ch chan<- *api.SyncResponse)
OnSyncCh sends into the channel every sync until the returned callback is called.
func (*Registry) SubscribeAllTimeline ¶
func (r *Registry) SubscribeAllTimeline(f interface{}) func()
SubscribeAllTimeline subscribes to the timeline of all rooms.
func (*Registry) SubscribeRoom ¶
SubscribeRoom subscribes the given function to a room's state and ephemeral event.
func (*Registry) SubscribeRoomEvents ¶
func (r *Registry) SubscribeRoomEvents( rID matrix.RoomID, types []event.Type, f interface{}) func()
SubscribeRoomEvents is like SubscribeRoom but registers multiple events at once.
func (*Registry) SubscribeRoomStateKey ¶
func (r *Registry) SubscribeRoomStateKey( rID matrix.RoomID, typ event.Type, key string, f interface{}) func()
SubscribeRoomStateKey is similarly to SubscribeRoom, except it only filters for the given state key.
func (*Registry) SubscribeRoomSync ¶
SubscribeRoomSync subscribes f to be called every time the room is synced.
func (*Registry) SubscribeTimeline ¶
SubscribeTimeline subscribes the given function to the timeline of a room. If the returned callback is called, then the room is removed from the handlers.
func (*Registry) SubscribeTimelineSync ¶
SubscribeTimelineSync is similar to SubscribeTimeline, except f is only called on the latest event each sync instead of on all of them.
func (*Registry) SubscribeUser ¶
SubscribeUser subscribes the given function with the given event type to be called on each user event. If typ is "*", then all events are called w/ it.