Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventStateLearner ¶
type EventStateLearner interface {
// CanLearn returns true if this can learn anything from the given event. Usually this is a type check.
// Note that the given event might not be a state event.
CanLearn(ctx context.Context, room *storage.StoredRoom, event gomatrixserverlib.PDU) (bool, error)
// LearnFrom processes the entire room state for a given room and learns whatever it can from it. The room
// state is not filtered by CanLearn - the implementation can do so if needed. The room state will always
// contain state events, and all events will be for the same room.
LearnFrom(ctx context.Context, room *storage.StoredRoom, roomState []gomatrixserverlib.PDU) error
}
EventStateLearner is something which is capable of "learning" specific parts of room state. Usually these will convert the state events received into a more usable format for later use.
func NewRoomStateLearner ¶
func NewRoomStateLearner(storage storage.PersistentStorage) (EventStateLearner, error)
type PolicyRulesLearner ¶
type PolicyRulesLearner struct {
// contains filtered or unexported fields
}
func (*PolicyRulesLearner) CanLearn ¶
func (p *PolicyRulesLearner) CanLearn(ctx context.Context, room *storage.StoredRoom, event gomatrixserverlib.PDU) (bool, error)
func (*PolicyRulesLearner) LearnFrom ¶
func (p *PolicyRulesLearner) LearnFrom(ctx context.Context, room *storage.StoredRoom, roomState []gomatrixserverlib.PDU) error
type RoomMembersLearner ¶
type RoomMembersLearner struct {
// contains filtered or unexported fields
}
func (*RoomMembersLearner) CanLearn ¶
func (r *RoomMembersLearner) CanLearn(ctx context.Context, room *storage.StoredRoom, event gomatrixserverlib.PDU) (bool, error)
func (*RoomMembersLearner) LearnFrom ¶
func (r *RoomMembersLearner) LearnFrom(ctx context.Context, room *storage.StoredRoom, roomState []gomatrixserverlib.PDU) error
type RoomStateLearner ¶
type RoomStateLearner struct {
// contains filtered or unexported fields
}
RoomStateLearner is an EventStateLearner which calls into other EventStateLearner instances
func (*RoomStateLearner) CanLearn ¶
func (l *RoomStateLearner) CanLearn(ctx context.Context, room *storage.StoredRoom, event gomatrixserverlib.PDU) (bool, error)
func (*RoomStateLearner) LearnFrom ¶
func (l *RoomStateLearner) LearnFrom(ctx context.Context, room *storage.StoredRoom, roomState []gomatrixserverlib.PDU) error
Click to show internal directories.
Click to hide internal directories.