Documentation ¶
Index ¶
- type ClientEvents
- type ContextEventResp
- type DeviceLists
- type InviteResponse
- type JoinResponse
- type JoinedRoomsResp
- type KeyChanged
- type LeaveResponse
- type MemberResponse
- type MessageEventResp
- type PaginationChunk
- type PrevEventRef
- type ReceiptUpdate
- type Response
- type RoomInfo
- type StateEventInState
- type StateEventInStateResp
- type StdHolder
- type StreamPosition
- type SyncRoom
- type SyncServerRequest
- type SyncServerResponse
- type SyncUnreadRequest
- type SyncUnreadResponse
- type ToDevice
- type TypingUpdate
- type UnreadNotifications
- type UserTimeLineStream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientEvents ¶
type ClientEvents []gomatrixserverlib.ClientEvent
func (ClientEvents) Len ¶
func (es ClientEvents) Len() int
func (ClientEvents) Less ¶
func (es ClientEvents) Less(i, j int) bool
func (ClientEvents) Swap ¶
func (es ClientEvents) Swap(i, j int)
type ContextEventResp ¶
type ContextEventResp struct { Start string `json:"start"` End string `json:"end"` EvsBefore []gomatrixserverlib.ClientEvent `json:"events_before"` Event gomatrixserverlib.ClientEvent `json:"event"` EvsAfter []gomatrixserverlib.ClientEvent `json:"events_after"` State []*gomatrixserverlib.ClientEvent `json:"state"` }
func (*ContextEventResp) Decode ¶
func (r *ContextEventResp) Decode(input []byte) error
func (*ContextEventResp) Encode ¶
func (r *ContextEventResp) Encode() ([]byte, error)
type DeviceLists ¶
type DeviceLists struct {
Changed []string `json:"changed"`
}
type InviteResponse ¶
type InviteResponse struct { InviteState struct { Events []gomatrixserverlib.ClientEvent `json:"events"` } `json:"invite_state"` }
InviteResponse represents a /sync response for a room which is under the 'invite' key.
func NewInviteResponse ¶
func NewInviteResponse() *InviteResponse
NewInviteResponse creates an empty response with initialised arrays.
type JoinResponse ¶
type JoinResponse struct { State struct { Events []gomatrixserverlib.ClientEvent `json:"events"` } `json:"state"` Timeline struct { Events []gomatrixserverlib.ClientEvent `json:"events"` Limited bool `json:"limited"` PrevBatch string `json:"prev_batch"` } `json:"timeline"` Ephemeral struct { Events []gomatrixserverlib.ClientEvent `json:"events"` } `json:"ephemeral"` AccountData struct { Events []gomatrixserverlib.ClientEvent `json:"events"` } `json:"account_data"` Unread *UnreadNotifications `json:"unread_notifications,omitempty"` }
JoinResponse represents a /sync response for a room which is under the 'join' key.
func NewJoinResponse ¶
func NewJoinResponse() *JoinResponse
NewJoinResponse creates an empty response with initialised arrays.
type JoinedRoomsResp ¶
type JoinedRoomsResp struct {
JoinedRooms []string `json:"joined_rooms,omitempty"`
}
func (*JoinedRoomsResp) Decode ¶
func (r *JoinedRoomsResp) Decode(input []byte) error
func (*JoinedRoomsResp) Encode ¶
func (r *JoinedRoomsResp) Encode() ([]byte, error)
type KeyChanged ¶
type KeyChanged struct {
Changes []string `json:"changed"`
}
func (*KeyChanged) Decode ¶
func (r *KeyChanged) Decode(input []byte) error
func (*KeyChanged) Encode ¶
func (r *KeyChanged) Encode() ([]byte, error)
type LeaveResponse ¶
type LeaveResponse struct { State struct { Events []gomatrixserverlib.ClientEvent `json:"events"` } `json:"state"` Timeline struct { Events []gomatrixserverlib.ClientEvent `json:"events"` Limited bool `json:"limited"` PrevBatch string `json:"prev_batch"` } `json:"timeline"` }
LeaveResponse represents a /sync response for a room which is under the 'leave' key.
func NewLeaveResponse ¶
func NewLeaveResponse() *LeaveResponse
NewLeaveResponse creates an empty response with initialised arrays.
type MemberResponse ¶
type MemberResponse struct {
Chunk []gomatrixserverlib.ClientEvent `json:"chunk"`
}
func (*MemberResponse) Decode ¶
func (r *MemberResponse) Decode(input []byte) error
func (*MemberResponse) Encode ¶
func (r *MemberResponse) Encode() ([]byte, error)
type MessageEventResp ¶
type MessageEventResp struct { Start string `json:"start,omitempty"` Chunk []gomatrixserverlib.ClientEvent `json:"chunk"` End string `json:"end,omitempty"` }
func (*MessageEventResp) Decode ¶
func (r *MessageEventResp) Decode(input []byte) error
func (*MessageEventResp) Encode ¶
func (r *MessageEventResp) Encode() ([]byte, error)
type PaginationChunk ¶
type PaginationChunk struct { Start string `json:"start"` Chunk []gomatrixserverlib.ClientEvent `json:"chunk"` End string `json:"end"` }
func (*PaginationChunk) Decode ¶
func (p *PaginationChunk) Decode(input []byte) error
func (*PaginationChunk) Encode ¶
func (p *PaginationChunk) Encode() ([]byte, error)
type PrevEventRef ¶
type PrevEventRef struct { PrevContent jsonRaw.RawMessage `json:"prev_content"` ReplacesState string `json:"replaces_state"` PrevSender string `json:"prev_sender"` PreOffset int64 `json:"prev_offset"` }
PrevEventRef represents a reference to a previous event in a state event upgrade
type ReceiptUpdate ¶
type Response ¶
type Response struct { NextBatch string `json:"next_batch"` AccountData struct { Events []gomatrixserverlib.ClientEvent `json:"events"` } `json:"account_data"` Presence struct { Events []gomatrixserverlib.ClientEvent `json:"events"` } `json:"presence"` Rooms struct { Join map[string]JoinResponse `json:"join"` Invite map[string]InviteResponse `json:"invite"` Leave map[string]LeaveResponse `json:"leave"` } `json:"rooms"` /* extensions */ // ToDevice send to device extension ToDevice ToDevice `json:"to_device"` // DeviceList encryptoapi key management /keyChange extension DeviceList DeviceLists `json:"device_lists"` // compatibility with no definition todo: del it SignNum map[string]int `json:"device_one_time_keys_count"` Lock *sync.Mutex `json:"-"` }
Response represents a /sync API response. See https://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-r0-sync
func NewResponse ¶
func NewResponse(pos StreamPosition) *Response
NewResponse creates an empty response with initialised maps.
type RoomInfo ¶
type RoomInfo struct { RoomID string `json:"room_id"` Membership string `json:"membership"` //Invite gomatrixserverlib.ClientEvent `json:"invite"` Messages PaginationChunk `json:"messages"` State []gomatrixserverlib.ClientEvent `json:"state"` Visibility string `json:"visibility", omitempty` AccountData []gomatrixserverlib.ClientEvent `json:"account_data"` Presence struct { Events []gomatrixserverlib.ClientEvent `json:"events"` } `json:"presence"` }
type StateEventInState ¶
type StateEventInState struct { gomatrixserverlib.ClientEvent PrevContent jsonRaw.RawMessage `json:"prev_content,omitempty"` ReplacesState string `json:"replaces_state,omitempty"` }
type StateEventInStateResp ¶
type StateEventInStateResp []StateEventInState
func (StateEventInStateResp) Decode ¶
func (r StateEventInStateResp) Decode(input []byte) error
func (StateEventInStateResp) Encode ¶
func (r StateEventInStateResp) Encode() ([]byte, error)
type StreamPosition ¶
type StreamPosition int64
StreamPosition represents the offset in the sync stream a client is at.
func (StreamPosition) String ¶
func (sp StreamPosition) String() string
String implements the Stringer interface.
type SyncServerRequest ¶
type SyncServerRequest struct { RequestType string `json:"request_type,omitempty"` InviteRooms []SyncRoom `json:"invite_rooms,omitempty"` JoinRooms []SyncRoom `json:"join_rooms,omitempty"` LeaveRooms []SyncRoom `json:"leave_rooms,omitempty"` JoinedRooms []string `json:"joined_rooms,omitempty"` UserID string `json:"user_id,omitempty"` DeviceID string `json:"device_id,omitempty"` ReceiptOffset int64 `json:"receipt_offset,omitempty"` MaxReceiptOffset int64 `json:"max_receipt_offset,omitempty"` IsHuman bool `json:"is_human,omitempty"` Limit int `json:"limit,omitempty"` LoadReady bool `json:"load_ready,omitempty"` SyncReady bool `json:"sync_ready,omitempty"` SyncInstance uint32 `json:"sync_instance"` IsFullSync bool `json:"is_full_sync"` Reply string TraceID string `json:"trace_id"` Slot uint32 `json:"slot"` RSlot uint32 `json:"rslot"` }
type SyncServerResponse ¶
type SyncServerResponse struct { Rooms struct { Join map[string]JoinResponse `json:"join,omitempty"` Invite map[string]InviteResponse `json:"invite,omitempty"` Leave map[string]LeaveResponse `json:"leave,omitempty"` } `json:"rooms,omitempty"` MaxReceiptOffset int64 `json:"max_receipt_offset,omitempty"` AllLoaded bool `json:"all_loaded,omitempty"` NewUsers []string `json:"new_users,omitempty"` Ready bool `json:"ready,omitempty"` MaxRoomOffset map[string]int64 `json:"max_room_offset,omitempty"` }
type SyncUnreadRequest ¶
type SyncUnreadResponse ¶
type SyncUnreadResponse struct {
Count int64 `json:"count,omitempty"`
}