learning

package
v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

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 (*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 (*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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL