Documentation ¶
Overview ¶
Package dispatcher provides definitions and functionality related to executing Matrix requests.
Index ¶
- Constants
- type Dispatcher
- func (d *Dispatcher) Close()
- func (d *Dispatcher) DeleteNotification(a *model.Application, n *model.DeleteNotification) error
- func (d *Dispatcher) DeregisterApplication(a *model.Application, u *model.User) error
- func (d *Dispatcher) IsOrphan(a *model.Application, u *model.User) (bool, error)
- func (d *Dispatcher) RegisterApplication(id uint, name, user string) (string, error)
- func (d *Dispatcher) RepairApplication(a *model.Application, u *model.User) error
- func (d *Dispatcher) SendNotification(a *model.Application, n *model.Notification) (eventID string, err error)
- func (d *Dispatcher) UpdateApplication(a *model.Application, behavior *configuration.RepairBehavior) error
- type MessageEvent
- type MessageFormat
- type MsgType
- type NewContent
- type RelatesTo
Constants ¶
const ( MessageFormatHTML = MessageFormat("org.matrix.custom.html") MsgTypeText = MsgType("m.text") )
Define matrix constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher holds information for sending notifications to clients.
func Create ¶
func Create(homeserver, username, password string, formatting configuration.Formatting) (*Dispatcher, error)
Create instanciates a dispatcher connection.
func (*Dispatcher) DeleteNotification ¶
func (d *Dispatcher) DeleteNotification(a *model.Application, n *model.DeleteNotification) error
DeleteNotification sends a notification to a given user that another notification is deleted
func (*Dispatcher) DeregisterApplication ¶
func (d *Dispatcher) DeregisterApplication(a *model.Application, u *model.User) error
DeregisterApplication deletes a channel for an application.
func (*Dispatcher) IsOrphan ¶
func (d *Dispatcher) IsOrphan(a *model.Application, u *model.User) (bool, error)
IsOrphan checks if the user is still connected to the channel.
func (*Dispatcher) RegisterApplication ¶
func (d *Dispatcher) RegisterApplication(id uint, name, user string) (string, error)
RegisterApplication creates a channel for an application.
func (*Dispatcher) RepairApplication ¶
func (d *Dispatcher) RepairApplication(a *model.Application, u *model.User) error
RepairApplication re-invites the user to the channel.
func (*Dispatcher) SendNotification ¶
func (d *Dispatcher) SendNotification(a *model.Application, n *model.Notification) (eventID string, err error)
SendNotification sends a notification to a given user.
func (*Dispatcher) UpdateApplication ¶
func (d *Dispatcher) UpdateApplication(a *model.Application, behavior *configuration.RepairBehavior) error
UpdateApplication updates a channel for an application.
type MessageEvent ¶
type MessageEvent struct { Body string `json:"body"` FormattedBody string `json:"formatted_body"` MsgType MsgType `json:"msgtype"` RelatesTo *RelatesTo `json:"m.relates_to,omitempty"` Format MessageFormat `json:"format"` NewContent *NewContent `json:"m.new_content,omitempty"` }
MessageEvent is the content of a matrix message event
type NewContent ¶
type NewContent struct { Body string `json:"body"` FormattedBody string `json:"formatted_body"` MsgType MsgType `json:"msgtype"` Format MessageFormat `json:"format"` }
NewContent holds information about an updated message event