Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authinfo ¶
type Authinfo struct { UserID string `json:"user_id"` HomeServer string `json:"home_server"` DeviceID string `json:"device_id"` AccessToken string `json:"access_token"` }
Authinfo defines the fields returned after logging in
type Event ¶
type Event struct { StateKey *string `json:"state_key,omitempty"` // The state key for the event. Only present on State Events. Sender string `json:"sender"` // The user ID of the sender of the event Type string `json:"type"` // The event type Timestamp int64 `json:"origin_server_ts"` // The unix timestamp when this message was sent by the origin server ID string `json:"event_id"` // The unique ID of this event RoomID string `json:"room_id"` // The room the event was sent to. May be nil (e.g. for presence) Redacts string `json:"redacts,omitempty"` // The event ID that was redacted if a m.room.redaction event Unsigned map[string]interface{} `json:"unsigned"` // The unsigned portions of the event, such as age and prev_content Content map[string]interface{} `json:"content"` // The JSON content of the event. PrevContent map[string]interface{} `json:"prev_content,omitempty"` // The JSON prev_content of the event. }
Event defines an event
type PackagedEvent ¶
PackagedEvent bundles an event with more information regarding it, such as the roomname in which the event was produced.
type RespSync ¶
type RespSync struct { NextBatch string `json:"next_batch"` AccountData struct { Events []Event `json:"events"` } `json:"account_data"` Presence struct { Events []Event `json:"events"` } `json:"presence"` Rooms struct { Leave map[string]struct { State struct { Events []Event `json:"events"` } `json:"state"` Timeline struct { Events []Event `json:"events"` Limited bool `json:"limited"` PrevBatch string `json:"prev_batch"` } `json:"timeline"` } `json:"leave"` Join map[string]struct { State struct { Events []Event `json:"events"` } `json:"state"` Timeline struct { Events []Event `json:"events"` Limited bool `json:"limited"` PrevBatch string `json:"prev_batch"` } `json:"timeline"` } `json:"join"` Invite map[string]struct { State struct { Events []Event } `json:"invite_state"` } `json:"invite"` } `json:"rooms"` }
RespSync defines the response from the sync
func SyncPartial ¶
func SyncPartial(authinfo Authinfo, nextBatch string, eventsChannel chan PackagedEvent) (RespSync, error)
SyncPartial syncs the state using sync token obtained in a previous request as a timestamp
type UploadResponse ¶
type UploadResponse struct {
ContentURI string `json:"content_uri,omitempty"`
}
UploadResponse is the responce recieved from the upload
Click to show internal directories.
Click to hide internal directories.