Documentation ¶
Index ¶
- type Data
- func (d *Data) AddRoomBatch(ctx context.Context, room *model.MatrixRoom)
- func (d *Data) AddServer(ctx context.Context, server *model.MatrixServer) error
- func (d *Data) BanRoom(ctx context.Context, roomID string) error
- func (d *Data) BatchServers(ctx context.Context, servers []string) error
- func (d *Data) Close() error
- func (d *Data) EachRoom(ctx context.Context, handler func(roomID string, data *model.MatrixRoom) bool)
- func (d *Data) FilterServers(ctx context.Context, filter func(server *model.MatrixServer) bool) map[string]*model.MatrixServer
- func (d *Data) FlushRoomBatch(ctx context.Context)
- func (d *Data) GetBannedRooms(ctx context.Context, serverName ...string) ([]string, error)
- func (d *Data) GetBiggestRooms(ctx context.Context, limit, offset int) []*model.MatrixRoom
- func (d *Data) GetIndexStats(ctx context.Context) *model.IndexStats
- func (d *Data) GetIndexStatsTL(ctx context.Context, prefix string) (map[time.Time]*model.IndexStats, error)
- func (d *Data) GetReportedRooms(ctx context.Context, serverName ...string) (map[string]string, error)
- func (d *Data) GetRoom(ctx context.Context, roomID string) (*model.MatrixRoom, error)
- func (d *Data) GetServerInfo(ctx context.Context, name string) (*model.MatrixServer, error)
- func (d *Data) GetServersRoomsCount(ctx context.Context) map[string]int
- func (d *Data) HasServer(ctx context.Context, name string) bool
- func (d *Data) IsReported(ctx context.Context, roomID string) bool
- func (d *Data) MarkServersOffline(ctx context.Context, keys []string)
- func (d *Data) RemoveRooms(ctx context.Context, keys []string)
- func (d *Data) RemoveServer(ctx context.Context, name string) error
- func (d *Data) RemoveServers(ctx context.Context, keys []string)
- func (d *Data) ReportRoom(ctx context.Context, roomID, reason string) error
- func (d *Data) SaveServersRooms(ctx context.Context, data map[string][]string) error
- func (d *Data) SetBiggestRooms(ctx context.Context, ids []string) error
- func (d *Data) SetFinishedAt(ctx context.Context, process string, finishedAt time.Time) error
- func (d *Data) SetIndexBannedRooms(ctx context.Context, rooms int) error
- func (d *Data) SetIndexBlockedServers(ctx context.Context, servers int) error
- func (d *Data) SetIndexIndexableServers(ctx context.Context, servers int) error
- func (d *Data) SetIndexIndexedRooms(ctx context.Context, rooms int) error
- func (d *Data) SetIndexOnlineServers(ctx context.Context, servers int) error
- func (d *Data) SetIndexParsedRooms(ctx context.Context, rooms int) error
- func (d *Data) SetIndexReportedRooms(ctx context.Context, rooms int) error
- func (d *Data) SetIndexStatsTL(ctx context.Context, calculatedAt time.Time, stats *model.IndexStats) error
- func (d *Data) SetServersRoomsCount(ctx context.Context, data map[string]int) error
- func (d *Data) SetStartedAt(ctx context.Context, process string, startedAt time.Time) error
- func (d *Data) UnbanRoom(ctx context.Context, roomID string) error
- func (d *Data) UnreportRoom(ctx context.Context, roomID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
func (*Data) AddRoomBatch ¶
func (d *Data) AddRoomBatch(ctx context.Context, room *model.MatrixRoom)
func (*Data) BatchServers ¶
BatchServers adds a batch of servers at once
func (*Data) EachRoom ¶
func (d *Data) EachRoom(ctx context.Context, handler func(roomID string, data *model.MatrixRoom) bool)
EachRoom allows to work with each known room
func (*Data) FilterServers ¶
func (d *Data) FilterServers(ctx context.Context, filter func(server *model.MatrixServer) bool) map[string]*model.MatrixServer
func (*Data) FlushRoomBatch ¶
FlushRoomBatch to ensure nothing is left
func (*Data) GetBannedRooms ¶
GetBannedRooms returns full list of the banned rooms
func (*Data) GetBiggestRooms ¶
func (*Data) GetIndexStats ¶
func (d *Data) GetIndexStats(ctx context.Context) *model.IndexStats
GetIndexStats returns index stats
func (*Data) GetIndexStatsTL ¶
func (d *Data) GetIndexStatsTL(ctx context.Context, prefix string) (map[time.Time]*model.IndexStats, error)
GetIndexStatsTL returns index stats for the given time prefix in RFC3339 format
func (*Data) GetReportedRooms ¶
func (d *Data) GetReportedRooms(ctx context.Context, serverName ...string) (map[string]string, error)
GetReportedRooms returns full list of the banned rooms with reasons
func (*Data) GetServerInfo ¶
GetServerInfo
func (*Data) GetServersRoomsCount ¶
GetServersRoomsCount returns the count of rooms for each server
func (*Data) IsReported ¶
IsReported returns true if room was already reported
func (*Data) MarkServersOffline ¶
MarkServersOffline from db
func (*Data) RemoveRooms ¶
RemoveRooms from db
func (*Data) RemoveServer ¶
RemoveServer info
func (*Data) RemoveServers ¶
RemoveServers from db
func (*Data) ReportRoom ¶
ReportRoom
func (*Data) SaveServersRooms ¶
SaveServersRooms saves the rooms for each server
func (*Data) SetBiggestRooms ¶
func (*Data) SetFinishedAt ¶
SetFinishedAt sets end time of the finished process
func (*Data) SetIndexBannedRooms ¶
SetIndexBannedRooms sets count of banned rooms
func (*Data) SetIndexBlockedServers ¶
SetIndexBlockedServers sets count of discovered online servers
func (*Data) SetIndexIndexableServers ¶
SetIndexIndexableServers sets count of discovered indexable servers
func (*Data) SetIndexIndexedRooms ¶
SetIndexIndexedRooms sets count of indexed rooms
func (*Data) SetIndexOnlineServers ¶
SetIndexOnlineServers sets count of discovered online servers
func (*Data) SetIndexParsedRooms ¶
SetIndexParsedRooms sets count of parsed rooms
func (*Data) SetIndexReportedRooms ¶
SetIndexReportedRooms sets count of banned rooms
func (*Data) SetIndexStatsTL ¶
func (d *Data) SetIndexStatsTL(ctx context.Context, calculatedAt time.Time, stats *model.IndexStats) error
SetIndexStatsTL sets index stats for the given time
func (*Data) SetServersRoomsCount ¶
SetServersRoomsCount sets the count of rooms for each server
func (*Data) SetStartedAt ¶
SetStartedAt sets start time of the new process