Documentation ¶
Index ¶
- type ApplicationServiceServer
- type Auth
- type Client
- func (cli *Client) CreateRoom(auth Auth, req CreateRoomReq) (CreateRoomResp, error)
- func (cli *Client) ForgetRoom(auth Auth, roomID string) error
- func (cli *Client) GetRoomAliasID(alias string) (GetRoomAliasIDResp, error)
- func (cli *Client) GetRoomMessages(auth Auth, roomID string, from, to, dir string, limit int, filter string) (GetRoomMessagesResp, error)
- func (cli *Client) GetRoomVisibility(id string) (GetRoomVisibilityResp, error)
- func (cli *Client) GetUserDisplayname(userID string) (resp GetUserDisplaynameResp, err error)
- func (cli *Client) KeysClaim(auth Auth, req KeysClaimReq) (KeysClaimResp, error)
- func (cli *Client) KeysQuery(auth Auth, req KeysQueryReq) (KeysQueryResp, error)
- func (cli *Client) KeysUpload(auth Auth, req KeysUploadReq) (KeysUploadResp, error)
- func (cli *Client) LeaveRoom(auth Auth, roomID string) error
- func (cli *Client) Login(body LoginBody) (LoginResp, error)
- func (cli *Client) Logout(auth Auth) error
- func (cli *Client) LogoutAll(auth Auth) error
- func (cli *Client) MediaDownload(serverName, mediaID string, filename string) (string, string, int64, io.ReadCloser, error)
- func (cli *Client) MediaThumbnail(serverName, mediaID, method string, width, height int) (string, int64, io.ReadCloser, error)
- func (cli *Client) MediaUpload(auth Auth, contentType, filename string, content io.Reader) (resp MediaUploadResp, err error)
- func (cli *Client) PutRoomEvent(auth Auth, roomID, eventType, txnID string, body PutRoomEventBody) (PutRoomEventResp, error)
- func (cli *Client) PutStateEvent(auth Auth, roomID, eventType, stateKey string, body PutStateEventBody) (PutStateEventResp, error)
- func (cli *Client) SendToDevice(auth Auth, eventType string, txnID string, req SendToDeviceReq) error
- func (cli *Client) Sync(auth Auth, filter, since string, fullState bool, setPresence string, ...) (SyncResp, error)
- func (cli *Client) Versions() (VersionsResp, error)
- func (cli *Client) Whoami(auth Auth) (WhoamiResp, error)
- type CreateRoomReq
- type CreateRoomReqInvite3PID
- type CreateRoomResp
- type GetRoomAliasIDResp
- type GetRoomMessagesResp
- type GetRoomVisibilityResp
- type GetUserDisplaynameResp
- type Identifier
- type KeysClaimReq
- type KeysClaimResp
- type KeysQueryReq
- type KeysQueryResp
- type KeysQueryRespDeviceKeys
- type KeysUploadReq
- type KeysUploadReqDeviceKeys
- type KeysUploadResp
- type LoginBody
- type LoginResp
- type MatrixError
- type MediaUploadResp
- type PutRoomEventBody
- type PutRoomEventResp
- type PutStateEventBody
- type PutStateEventResp
- type ReqTransactions
- type SendToDeviceReq
- type SyncResp
- type SyncRespAccountData
- type SyncRespDeviceLists
- type SyncRespEphemeral
- type SyncRespInviteState
- type SyncRespPresence
- type SyncRespRoomSummary
- type SyncRespRooms
- type SyncRespRoomsInvite
- type SyncRespRoomsJoin
- type SyncRespRoomsLeave
- type SyncRespState
- type SyncRespTimeline
- type SyncRespToDevice
- type SyncRespUnreadNotificationCounts
- type SyncRespUnsignedData
- type VersionsResp
- type WhoamiResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationServiceServer ¶
type ApplicationServiceServer struct { Server *http.Server HSToken string Transaction func(ReqTransactions, string) }
func (*ApplicationServiceServer) ListenAndServe ¶
func (as *ApplicationServiceServer) ListenAndServe() error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateRoom ¶
func (cli *Client) CreateRoom(auth Auth, req CreateRoomReq) (CreateRoomResp, error)
func (*Client) GetRoomAliasID ¶
func (cli *Client) GetRoomAliasID(alias string) (GetRoomAliasIDResp, error)
func (*Client) GetRoomMessages ¶
func (*Client) GetRoomVisibility ¶
func (cli *Client) GetRoomVisibility(id string) (GetRoomVisibilityResp, error)
func (*Client) GetUserDisplayname ¶
func (cli *Client) GetUserDisplayname(userID string) (resp GetUserDisplaynameResp, err error)
func (*Client) KeysClaim ¶
func (cli *Client) KeysClaim(auth Auth, req KeysClaimReq) (KeysClaimResp, error)
func (*Client) KeysQuery ¶
func (cli *Client) KeysQuery(auth Auth, req KeysQueryReq) (KeysQueryResp, error)
func (*Client) KeysUpload ¶
func (cli *Client) KeysUpload(auth Auth, req KeysUploadReq) (KeysUploadResp, error)
func (*Client) MediaDownload ¶
func (*Client) MediaThumbnail ¶
func (*Client) MediaUpload ¶
func (*Client) PutRoomEvent ¶
func (cli *Client) PutRoomEvent(auth Auth, roomID, eventType, txnID string, body PutRoomEventBody) (PutRoomEventResp, error)
func (*Client) PutStateEvent ¶
func (cli *Client) PutStateEvent(auth Auth, roomID, eventType, stateKey string, body PutStateEventBody) (PutStateEventResp, error)
func (*Client) SendToDevice ¶
func (*Client) Versions ¶
func (cli *Client) Versions() (VersionsResp, error)
type CreateRoomReq ¶
type CreateRoomReq struct { Visibility string `json:"visibility,omitempty"` RoomAliasName string `json:"room_alias_name,omitempty"` Name string `json:"name,omitempty"` Topic string `json:"topic,omitempty"` Invite []string `json:"invite,omitempty"` Invite3PID []CreateRoomReqInvite3PID `json:"invite_3pid,omitempty"` RoomVersion string `json:"room_version,omitempty"` CreationContent map[string]interface{} `json:"creation_content,omitempty"` InitialState []interface{} `json:"initial_state,omitempty"` Preset string `json:"preset,omitempty"` IsDirect bool `json:"is_direct,omitempty"` PowerLevelContentOverride map[string]interface{} `json:"power_level_content_override,omitempty"` }
type CreateRoomReqInvite3PID ¶
type CreateRoomResp ¶
type CreateRoomResp struct {
RoomID string `json:"room_id"`
}
type GetRoomAliasIDResp ¶
type GetRoomMessagesResp ¶
type GetRoomMessagesResp struct { Start string `json:"start,omitempty"` End string `json:"end,omitempty"` Chunk []json.RawMessage `json:"chunk,omitempty"` State []json.RawMessage `json:"state,omitempty"` }
type GetRoomVisibilityResp ¶
type GetRoomVisibilityResp struct {
Visibility string `json:"visibility"`
}
type GetUserDisplaynameResp ¶
type GetUserDisplaynameResp struct {
Displayname string `json:"displayname"`
}
type Identifier ¶
type Identifier map[string]interface{}
5.3.6
func New3rdpartyIdentifer ¶
func New3rdpartyIdentifer(medium, address string) Identifier
func NewPhoneIdentifer ¶
func NewPhoneIdentifer(country, phone string) Identifier
func NewUserIdentifer ¶
func NewUserIdentifer(username string) Identifier
type KeysClaimReq ¶
type KeysClaimResp ¶
type KeysQueryReq ¶
type KeysQueryResp ¶
type KeysQueryResp struct { Failures map[string]interface{} DeviceKeys map[string]map[string]KeysQueryRespDeviceKeys `json:"device_keys"` }
type KeysQueryRespDeviceKeys ¶
type KeysQueryRespDeviceKeys struct { UserID string `json:"user_id"` DeviceID string `json:"device_id"` Algorithms []string `json:"algorithms"` Keys map[string]string `json:"keys"` Signatures map[string]map[string]string `json:"signatures"` Unsigned struct { DeviceDisplayName string `json:"device_display_name"` } `json:"unsigned"` }
type KeysUploadReq ¶
type KeysUploadReq struct { DeviceKeys *KeysUploadReqDeviceKeys `json:"device_keys,omitempty"` OneTimeKeys map[string]interface{} `json:"one_time_keys,omitempty"` }
type KeysUploadReqDeviceKeys ¶
type KeysUploadResp ¶
type LoginBody ¶
type LoginBody struct { Type string `json:"type"` Identifier Identifier `json:"identifier,omitempty"` User string `json:"user,omitempty"` Medium string `json:"medium,omitempty"` Address string `json:"address,omitempty"` Password string `json:"password,omitempty"` Token string `json:"token,omitempty"` DeviceID string `json:"device_id,omitempty"` InitialDeviceDisplayName string `json:"initial_device_display_name,omitempty"` }
5.4.2
type LoginResp ¶
type LoginResp struct { UserID string `json:"user_id"` AccessToken string `json:"access_token"` HomeServer string `json:"home_server"` DeviceID string `json:"device_id"` WellKnown struct { Homeserver struct { BaseURL string `json:"base_url"` } `json:"m.homeserver"` IdentityServer struct { BaseURL string `json:"base_url"` } `json:"m.identity_server"` } `json:"well_known"` }
type MatrixError ¶
func (MatrixError) Error ¶
func (m MatrixError) Error() string
type MediaUploadResp ¶
type MediaUploadResp struct {
ContentURI string `json:"content_uri"`
}
type PutRoomEventResp ¶
type PutRoomEventResp struct {
EventID string `json:"event_id"`
}
type PutStateEventResp ¶
type PutStateEventResp struct {
EventID string `json:"event_id"`
}
type ReqTransactions ¶
type ReqTransactions struct {
Events []json.RawMessage `json:"events"`
}
type SendToDeviceReq ¶
type SyncResp ¶
type SyncResp struct { NextBatch string `json:"next_batch"` Rooms SyncRespRooms `json:"rooms,omitempty"` Presence SyncRespPresence `json:"presence,omitempty"` AccountData SyncRespAccountData `json:"account_data,omitempty"` ToDevice SyncRespToDevice `json:"to_device,omitempty"` DeviceLists SyncRespDeviceLists `json:"device_lists,omitempty"` DeviceOneTimeKeysCount map[string]int64 `json:"device_one_time_keys_count,omitempty"` }
9.4.1
type SyncRespAccountData ¶
type SyncRespAccountData struct {
Events []json.RawMessage `json:"events,omitempty"`
}
type SyncRespDeviceLists ¶
type SyncRespEphemeral ¶
type SyncRespEphemeral struct {
Events []json.RawMessage `json:"events,omitempty"`
}
type SyncRespInviteState ¶
type SyncRespInviteState struct {
Events []json.RawMessage `json:"events,omitempty"`
}
type SyncRespPresence ¶
type SyncRespPresence struct {
Events []json.RawMessage `json:"events,omitempty"`
}
type SyncRespRoomSummary ¶
type SyncRespRooms ¶
type SyncRespRooms struct { Join map[string]SyncRespRoomsJoin `json:"join,omitempty"` Invite map[string]SyncRespRoomsInvite `json:"invite,omitempty"` Leave map[string]SyncRespRoomsLeave `json:"leave,omitempty"` }
type SyncRespRoomsInvite ¶
type SyncRespRoomsInvite struct {
InviteState SyncRespInviteState `json:"invite_state,omitempty"`
}
type SyncRespRoomsJoin ¶
type SyncRespRoomsJoin struct { Summary SyncRespRoomSummary `json:"summary,omitempty"` State SyncRespState `json:"state,omitempty"` Timeline SyncRespTimeline `json:"timeline,omitempty"` Ephemeral SyncRespEphemeral `json:"ephemeral,omitempty"` AccountData SyncRespAccountData `json:"account_data,omitempty"` UnreadNotifications SyncRespUnreadNotificationCounts `json:"unread_notifications,omitempty"` }
type SyncRespRoomsLeave ¶
type SyncRespRoomsLeave struct { State SyncRespState `json:"state,omitempty"` Timeline SyncRespTimeline `json:"timeline,omitempty"` AccountData SyncRespAccountData `json:"account_data,omitempty"` }
type SyncRespState ¶
type SyncRespState struct {
Events []json.RawMessage `json:"events,omitempty"`
}
type SyncRespTimeline ¶
type SyncRespTimeline struct { Events []json.RawMessage `json:"events,omitempty"` Limited bool `json:"limited,omitempty"` PrevBatch string `json:"prev_batch,omitempty"` }
type SyncRespToDevice ¶
type SyncRespToDevice struct {
Events []json.RawMessage `json:"events"`
}
type SyncRespUnsignedData ¶
type SyncRespUnsignedData struct { Age int64 `json:"age,omitempty"` RedactedBecause json.RawMessage `json:"redacted_because,omitempty"` TransactionID string `json:"transaction_id,omitempty"` }
type VersionsResp ¶
type VersionsResp struct { Versions []string `json:"versions"` UnstableFeatures map[string]bool `json:"unstable_features,omitempty"` }
2.1
type WhoamiResp ¶
type WhoamiResp struct {
UserID string `json:"user_Id"`
}
Click to show internal directories.
Click to hide internal directories.