Documentation
¶
Overview ¶
Package api provides the types that are used to communicate with the typing server.
Index ¶
- func SendToDevice(ctx context.Context, eduAPI EDUServerInputAPI, ...) error
- func SendTyping(ctx context.Context, eduAPI EDUServerInputAPI, userID, roomID string, ...) error
- type EDUServerInputAPI
- type InputSendToDeviceEvent
- type InputSendToDeviceEventRequest
- type InputSendToDeviceEventResponse
- type InputTypingEvent
- type InputTypingEventRequest
- type InputTypingEventResponse
- type OutputSendToDeviceEvent
- type OutputTypingEvent
- type TypingEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendToDevice ¶
func SendToDevice( ctx context.Context, eduAPI EDUServerInputAPI, sender, userID, deviceID, eventType string, message interface{}, ) error
SendToDevice sends a typing event to EDU server
func SendTyping ¶
func SendTyping( ctx context.Context, eduAPI EDUServerInputAPI, userID, roomID string, typing bool, timeoutMS int64, ) error
SendTyping sends a typing event to EDU server
Types ¶
type EDUServerInputAPI ¶
type EDUServerInputAPI interface {
InputTypingEvent(
ctx context.Context,
request *InputTypingEventRequest,
response *InputTypingEventResponse,
) error
InputSendToDeviceEvent(
ctx context.Context,
request *InputSendToDeviceEventRequest,
response *InputSendToDeviceEventResponse,
) error
}
EDUServerInputAPI is used to write events to the typing server.
type InputSendToDeviceEvent ¶
type InputSendToDeviceEvent struct {
UserID string `json:"user_id"`
DeviceID string `json:"device_id"`
gomatrixserverlib.SendToDeviceEvent
}
type InputSendToDeviceEventRequest ¶
type InputSendToDeviceEventRequest struct {
InputSendToDeviceEvent InputSendToDeviceEvent `json:"input_send_to_device_event"`
}
InputSendToDeviceEventRequest is a request to EDUServerInputAPI
type InputSendToDeviceEventResponse ¶
type InputSendToDeviceEventResponse struct{}
InputSendToDeviceEventResponse is a response to InputSendToDeviceEventRequest
type InputTypingEvent ¶
type InputTypingEvent struct {
// UserID of the user to update typing status.
UserID string `json:"user_id"`
// RoomID of the room the user is typing (or has stopped).
RoomID string `json:"room_id"`
// Typing is true if the user is typing, false if they have stopped.
Typing bool `json:"typing"`
// Timeout is the interval in milliseconds for which the user should be marked as typing.
TimeoutMS int64 `json:"timeout"`
// OriginServerTS when the server received the update.
OriginServerTS gomatrixserverlib.Timestamp `json:"origin_server_ts"`
}
InputTypingEvent is an event for notifying the typing server about typing updates.
type InputTypingEventRequest ¶
type InputTypingEventRequest struct {
InputTypingEvent InputTypingEvent `json:"input_typing_event"`
}
InputTypingEventRequest is a request to EDUServerInputAPI
type InputTypingEventResponse ¶
type InputTypingEventResponse struct{}
InputTypingEventResponse is a response to InputTypingEvents
type OutputSendToDeviceEvent ¶
type OutputSendToDeviceEvent struct {
UserID string `json:"user_id"`
DeviceID string `json:"device_id"`
gomatrixserverlib.SendToDeviceEvent
}
OutputSendToDeviceEvent is an entry in the send-to-device output kafka log. This contains the full event content, along with the user ID and device ID to which it is destined.
type OutputTypingEvent ¶
type OutputTypingEvent struct {
// The Event for the typing edu event.
Event TypingEvent `json:"event"`
// ExpireTime is the interval after which the user should no longer be
// considered typing. Only available if Event.Typing is true.
ExpireTime *time.Time
}
OutputTypingEvent is an entry in typing server output kafka log. This contains the event with extra fields used to create 'm.typing' event in clientapi & federation.