Documentation
¶
Index ¶
- Constants
- Variables
- func MustMakeAuditQueue(size int) *audit.Queue
- func MustMakePDU(event *BaseClientEvent) gomatrixserverlib.PDU
- type BaseClientEvent
- type MemoryContentScanner
- type MemoryPubsub
- type MemoryStorage
- func (m *MemoryStorage) Close() error
- func (m *MemoryStorage) CreateCommunity(ctx context.Context, name string) (*storage.StoredCommunity, error)
- func (m *MemoryStorage) DeleteRoom(ctx context.Context, roomId string) error
- func (m *MemoryStorage) GetAllRooms(ctx context.Context) ([]*storage.StoredRoom, error)
- func (m *MemoryStorage) GetCommunity(ctx context.Context, communityId string) (*storage.StoredCommunity, error)
- func (m *MemoryStorage) GetEventResult(ctx context.Context, eventId string) (*storage.StoredEventResult, error)
- func (m *MemoryStorage) GetRoom(ctx context.Context, roomId string) (*storage.StoredRoom, error)
- func (m *MemoryStorage) GetTrustData(ctx context.Context, sourceName string, key string, result any) error
- func (m *MemoryStorage) GetUserIdsAndDisplayNamesByRoomId(ctx context.Context, roomId string) ([]string, []string, error)
- func (m *MemoryStorage) IsUserBannedInList(ctx context.Context, listRoomId string, userId string) (bool, error)
- func (m *MemoryStorage) PopStateLearnQueue(ctx context.Context) (*storage.StateLearnQueueItem, storage.Transaction, error)
- func (m *MemoryStorage) PushStateLearnQueue(ctx context.Context, item *storage.StateLearnQueueItem) error
- func (m *MemoryStorage) SetListBanRules(ctx context.Context, listRoomId string, entityToEntityType map[string]string) error
- func (m *MemoryStorage) SetTrustData(ctx context.Context, sourceName string, key string, data any) error
- func (m *MemoryStorage) SetUserIdsAndDisplayNamesByRoomId(ctx context.Context, roomId string, userIds []string, displayNames []string) error
- func (m *MemoryStorage) UpsertCommunity(ctx context.Context, community *storage.StoredCommunity) error
- func (m *MemoryStorage) UpsertEventResult(ctx context.Context, event *storage.StoredEventResult) error
- func (m *MemoryStorage) UpsertRoom(ctx context.Context, room *storage.StoredRoom) error
- type MemoryTransaction
- type StaticMediaDownloader
Constants ¶
View Source
const ErrorEventResultId = "$ERROR"
Variables ¶
View Source
var SimulatedError = errors.New("simulated error")
Functions ¶
func MustMakeAuditQueue ¶
func MustMakePDU ¶
func MustMakePDU(event *BaseClientEvent) gomatrixserverlib.PDU
Types ¶
type BaseClientEvent ¶
type BaseClientEvent struct {
RoomId string `json:"room_id"`
EventId string `json:"event_id"`
Type string `json:"type"`
StateKey *string `json:"state_key"`
Sender string `json:"sender"`
Content map[string]any `json:"content"`
StickyUntil time.Time `json:"-"` // exclude from JSON to avoid making the event improper/too large
}
type MemoryContentScanner ¶
func NewMemoryContentScanner ¶
func NewMemoryContentScanner(t *testing.T) *MemoryContentScanner
func (*MemoryContentScanner) Expect ¶
func (m *MemoryContentScanner) Expect(contentType content.Type, content []byte, retClassifications []classification.Classification, retErr error)
func (*MemoryContentScanner) Scan ¶
func (m *MemoryContentScanner) Scan(ctx context.Context, contentType content.Type, content []byte) ([]classification.Classification, error)
type MemoryPubsub ¶
type MemoryPubsub struct {
// contains filtered or unexported fields
}
func NewMemoryPubsub ¶
func NewMemoryPubsub(t *testing.T) *MemoryPubsub
func (*MemoryPubsub) Close ¶
func (m *MemoryPubsub) Close() error
func (*MemoryPubsub) Unsubscribe ¶
func (m *MemoryPubsub) Unsubscribe(ctx context.Context, ch <-chan string) error
type MemoryStorage ¶
type MemoryStorage struct {
// contains filtered or unexported fields
}
func NewMemoryStorage ¶
func NewMemoryStorage(t *testing.T) *MemoryStorage
func (*MemoryStorage) Close ¶
func (m *MemoryStorage) Close() error
func (*MemoryStorage) CreateCommunity ¶
func (m *MemoryStorage) CreateCommunity(ctx context.Context, name string) (*storage.StoredCommunity, error)
func (*MemoryStorage) DeleteRoom ¶
func (m *MemoryStorage) DeleteRoom(ctx context.Context, roomId string) error
func (*MemoryStorage) GetAllRooms ¶
func (m *MemoryStorage) GetAllRooms(ctx context.Context) ([]*storage.StoredRoom, error)
func (*MemoryStorage) GetCommunity ¶
func (m *MemoryStorage) GetCommunity(ctx context.Context, communityId string) (*storage.StoredCommunity, error)
func (*MemoryStorage) GetEventResult ¶
func (m *MemoryStorage) GetEventResult(ctx context.Context, eventId string) (*storage.StoredEventResult, error)
func (*MemoryStorage) GetRoom ¶
func (m *MemoryStorage) GetRoom(ctx context.Context, roomId string) (*storage.StoredRoom, error)
func (*MemoryStorage) GetTrustData ¶
func (*MemoryStorage) GetUserIdsAndDisplayNamesByRoomId ¶
func (*MemoryStorage) IsUserBannedInList ¶
func (*MemoryStorage) PopStateLearnQueue ¶
func (m *MemoryStorage) PopStateLearnQueue(ctx context.Context) (*storage.StateLearnQueueItem, storage.Transaction, error)
func (*MemoryStorage) PushStateLearnQueue ¶
func (m *MemoryStorage) PushStateLearnQueue(ctx context.Context, item *storage.StateLearnQueueItem) error
func (*MemoryStorage) SetListBanRules ¶
func (*MemoryStorage) SetTrustData ¶
func (*MemoryStorage) SetUserIdsAndDisplayNamesByRoomId ¶
func (*MemoryStorage) UpsertCommunity ¶
func (m *MemoryStorage) UpsertCommunity(ctx context.Context, community *storage.StoredCommunity) error
func (*MemoryStorage) UpsertEventResult ¶
func (m *MemoryStorage) UpsertEventResult(ctx context.Context, event *storage.StoredEventResult) error
func (*MemoryStorage) UpsertRoom ¶
func (m *MemoryStorage) UpsertRoom(ctx context.Context, room *storage.StoredRoom) error
type MemoryTransaction ¶
type MemoryTransaction struct {
// contains filtered or unexported fields
}
func (*MemoryTransaction) Commit ¶
func (t *MemoryTransaction) Commit() error
func (*MemoryTransaction) Rollback ¶
func (t *MemoryTransaction) Rollback() error
type StaticMediaDownloader ¶
func MustMakeMediaDownloader ¶
func MustMakeMediaDownloader(t *testing.T) *StaticMediaDownloader
func (*StaticMediaDownloader) DownloadMedia ¶
func (*StaticMediaDownloader) Set ¶
func (s *StaticMediaDownloader) Set(origin string, mediaId string, bytes []byte) *StaticMediaDownloader
Click to show internal directories.
Click to hide internal directories.