diff options
author | Alex Auvolat <alex@adnab.me> | 2020-02-16 22:07:41 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-02-16 22:07:41 +0100 |
commit | d2ccd6763a8a8a88e5cdbf95fd665e679f8e187e (patch) | |
tree | 8d17148b9424019c38d0d19f1b0e2ccef96b87e0 /mxlib | |
parent | 046ec6380b7bb363e537ade7fd254b5505dde32d (diff) | |
download | easybridge-d2ccd6763a8a8a88e5cdbf95fd665e679f8e187e.tar.gz easybridge-d2ccd6763a8a8a88e5cdbf95fd665e679f8e187e.zip |
Begin some bridging
Diffstat (limited to 'mxlib')
-rw-r--r-- | mxlib/api.go | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/mxlib/api.go b/mxlib/api.go index 59e1267..cb2d10c 100644 --- a/mxlib/api.go +++ b/mxlib/api.go @@ -4,6 +4,15 @@ import ( _ "encoding/json" ) +type MxError struct { + ErrCode string `json:"errcode"` + ErrMsg string `json:"error"` +} + +func (e *MxError) Error() string { + return e.ErrMsg +} + type Transaction struct { Events []Event `json:"events"` } @@ -16,3 +25,55 @@ type Event struct { Sender string `json:"sender"` OriginServerTs int `json:"origin_server_ts"` } + +type RegisterRequest struct { + Username string `json:"username"` +} + +type RegisterResponse struct { + UserId string `json:"user_id"` + AccessToken string `json:"access_token"` + DeviceId string `json:"device_id"` +} + +type ProfileDisplaynameRequest struct { + Displayname string `json:"displayname"` +} + +type CreateRoomRequest struct { + Preset string `json:"preset"` + RoomAliasName string `json:"room_alias_name"` + Name string `json:"name"` + Topic string `json:"topic"` + Invite []string `json:"invite"` + CreationContent map[string]interface{} `json:"creation_content"` +} + +type CreateRoomResponse struct { + RoomId string `json:"room_id"` +} + +type DirectoryRoomResponse struct { + RoomId string `json:"room_id"` + Servers []string `json:"string"` +} + +type RoomInviteRequest struct { + UserId string `json:"user_id"` +} + +type RoomKickRequest struct { + UserId string `json:"user_id"` + Reason string `json:"reason"` +} +type RoomJoinResponse struct { + RoomId string `json:"room_id"` +} + +type RoomSendRequest struct { + MsgType string `json:"msgtype"` + Body string `json:"body"` +} +type RoomSendResponse struct { + EventId string `json:"event_id"` +} |