mirror of https://github.com/matrix-org/gomatrix
Merge pull request #10 from matrix-org/kegan/api-versions
Add /versions endpoint
This commit is contained in:
commit
42ba11ab7b
|
@ -350,6 +350,13 @@ func (cli *Client) Login(req *ReqLogin, setOnClient bool) (resp *RespLogin, err
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Versions returns the list of supported Matrix versions on this homeserver. See http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-versions
|
||||||
|
func (cli *Client) Versions() (resp *RespVersions, err error) {
|
||||||
|
urlPath := cli.BuildBaseURL("_matrix", "client", "versions")
|
||||||
|
_, err = cli.MakeRequest("GET", urlPath, nil, &resp)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// JoinRoom joins the client to a room ID or alias. See http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-join-roomidoralias
|
// JoinRoom joins the client to a room ID or alias. See http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-join-roomidoralias
|
||||||
//
|
//
|
||||||
// If serverName is specified, this will be added as a query param to instruct the homeserver to join via that server. If content is specified, it will
|
// If serverName is specified, this will be added as a query param to instruct the homeserver to join via that server. If content is specified, it will
|
||||||
|
|
|
@ -17,6 +17,11 @@ type RespCreateFilter struct {
|
||||||
FilterID string `json:"filter_id"`
|
FilterID string `json:"filter_id"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RespVersions is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#get-matrix-client-versions
|
||||||
|
type RespVersions struct {
|
||||||
|
Versions []string `json:"versions"`
|
||||||
|
}
|
||||||
|
|
||||||
// RespJoinRoom is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-join
|
// RespJoinRoom is the JSON response for http://matrix.org/docs/spec/client_server/r0.2.0.html#post-matrix-client-r0-rooms-roomid-join
|
||||||
type RespJoinRoom struct {
|
type RespJoinRoom struct {
|
||||||
RoomID string `json:"room_id"`
|
RoomID string `json:"room_id"`
|
||||||
|
|
Loading…
Reference in New Issue