filter

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package filter allows creating sync filters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Limit      int      `json:"limit,omitempty"`
	NotSenders []string `json:"not_senders,omitempty"`
	Senders    []string `json:"senders,omitempty"`
	NotTypes   []string `json:"not_types,omitempty"`
	Types      []string `json:"types,omitempty"`
}

Event allows filering general events.

type Filter

type Filter struct {
	AccountData Event    `json:"account_data"`
	Fields      []string `json:"event_fields,omitempty"`
	Format      string   `json:"event_format,omitempty"`
	Presence    Event    `json:"presence"`
	Room        Room     `json:"room"`
}

Filter defines a filter used for syncing content.

func (Filter) Register

func (f Filter) Register(ctx context.Context, cli matrix.Client) (string, error)

Register the filter with the given matrix client and return its ID.

type Room

type Room struct {
	AccountData  RoomEvent `json:"account_data"`
	Ephemeral    RoomEvent `json:"ephemeral"`
	IncludeLeave bool      `json:"include_leave,omitempty"`
	NotRooms     []string  `json:"not_rooms,omitempty"`
	Rooms        []string  `json:"rooms,omitempty"`
	State        RoomEvent `json:"state,omitempty"`
	Timeline     RoomEvent `json:"timeline,omitempty"`
}

Room allows to filter information specific to rooms.

type RoomEvent

type RoomEvent struct {
	ContainsURL             *bool    `json:"contains_url,omitempty"`
	IncludeRedundantMembers bool     `json:"include_redundant_members,omitempty"`
	LazyLoadMembers         bool     `json:"lazy_load_members,omitempty"`
	Limit                   int      `json:"limit,omitempty"`
	NotSenders              []string `json:"not_senders,omitempty"`
	Senders                 []string `json:"senders,omitempty"`
	NotTypes                []string `json:"not_types,omitempty"`
	Types                   []string `json:"types,omitempty"`
	NotRooms                []string `json:"not_rooms,omitempty"`
	Rooms                   []string `json:"rooms,omitempty"`
}

RoomEvent allows filering room events.

Jump to

Keyboard shortcuts

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