Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FinClip
ligase
提交
4e7862e3
ligase
项目概览
FinClip
/
ligase
通知
37
Star
8
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ligase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
4e7862e3
编写于
7月 12, 2017
作者:
M
Mark Haines
提交者:
GitHub
7月 12, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make the room server RPC API json formats more consistent with our other APIs (#156)
上级
cea9e317
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
19 addition
and
18 deletion
+19
-18
src/github.com/matrix-org/dendrite/roomserver/api/query.go
src/github.com/matrix-org/dendrite/roomserver/api/query.go
+19
-18
未找到文件。
src/github.com/matrix-org/dendrite/roomserver/api/query.go
浏览文件 @
4e7862e3
...
@@ -18,17 +18,18 @@ import (
...
@@ -18,17 +18,18 @@ import (
"bytes"
"bytes"
"encoding/json"
"encoding/json"
"fmt"
"fmt"
"github.com/matrix-org/gomatrixserverlib"
"net/http"
"net/http"
"github.com/matrix-org/gomatrixserverlib"
)
)
// QueryLatestEventsAndStateRequest is a request to QueryLatestEventsAndState
// QueryLatestEventsAndStateRequest is a request to QueryLatestEventsAndState
type
QueryLatestEventsAndStateRequest
struct
{
type
QueryLatestEventsAndStateRequest
struct
{
// The room ID to query the latest events for.
// The room ID to query the latest events for.
RoomID
string
RoomID
string
`json:"room_id"`
// The state key tuples to fetch from the room current state.
// The state key tuples to fetch from the room current state.
// If this list is empty or nil then no state events are returned.
// If this list is empty or nil then no state events are returned.
StateToFetch
[]
gomatrixserverlib
.
StateKeyTuple
StateToFetch
[]
gomatrixserverlib
.
StateKeyTuple
`json:"state_to_fetch"`
}
}
// QueryLatestEventsAndStateResponse is a response to QueryLatestEventsAndState
// QueryLatestEventsAndStateResponse is a response to QueryLatestEventsAndState
...
@@ -39,29 +40,29 @@ type QueryLatestEventsAndStateResponse struct {
...
@@ -39,29 +40,29 @@ type QueryLatestEventsAndStateResponse struct {
QueryLatestEventsAndStateRequest
QueryLatestEventsAndStateRequest
// Does the room exist?
// Does the room exist?
// If the room doesn't exist this will be false and LatestEvents will be empty.
// If the room doesn't exist this will be false and LatestEvents will be empty.
RoomExists
bool
RoomExists
bool
`json:"room_exists"`
// The latest events in the room.
// The latest events in the room.
// These are used to set the prev_events when sending an event.
// These are used to set the prev_events when sending an event.
LatestEvents
[]
gomatrixserverlib
.
EventReference
LatestEvents
[]
gomatrixserverlib
.
EventReference
`json:"latest_events"`
// The state events requested.
// The state events requested.
// This list will be in an arbitrary order.
// This list will be in an arbitrary order.
// These are used to set the auth_events when sending an event.
// These are used to set the auth_events when sending an event.
// These are used to check whether the event is allowed.
// These are used to check whether the event is allowed.
StateEvents
[]
gomatrixserverlib
.
Event
StateEvents
[]
gomatrixserverlib
.
Event
`json:"state_events"`
// The depth of the latest events.
// The depth of the latest events.
// This is one greater than the maximum depth of the latest events.
// This is one greater than the maximum depth of the latest events.
// This is used to set the depth when sending an event.
// This is used to set the depth when sending an event.
Depth
int64
Depth
int64
`json:"depth"`
}
}
// QueryStateAfterEventsRequest is a request to QueryStateAfterEvents
// QueryStateAfterEventsRequest is a request to QueryStateAfterEvents
type
QueryStateAfterEventsRequest
struct
{
type
QueryStateAfterEventsRequest
struct
{
// The room ID to query the state in.
// The room ID to query the state in.
RoomID
string
RoomID
string
`json:"room_id"`
// The list of previous events to return the events after.
// The list of previous events to return the events after.
PrevEventIDs
[]
string
PrevEventIDs
[]
string
`json:"prev_event_ids"`
// The state key tuples to fetch from the state
// The state key tuples to fetch from the state
StateToFetch
[]
gomatrixserverlib
.
StateKeyTuple
StateToFetch
[]
gomatrixserverlib
.
StateKeyTuple
`json:"state_to_fetch"`
}
}
// QueryStateAfterEventsResponse is a response to QueryStateAfterEvents
// QueryStateAfterEventsResponse is a response to QueryStateAfterEvents
...
@@ -70,19 +71,19 @@ type QueryStateAfterEventsResponse struct {
...
@@ -70,19 +71,19 @@ type QueryStateAfterEventsResponse struct {
QueryStateAfterEventsRequest
QueryStateAfterEventsRequest
// Does the room exist on this roomserver?
// Does the room exist on this roomserver?
// If the room doesn't exist this will be false and StateEvents will be empty.
// If the room doesn't exist this will be false and StateEvents will be empty.
RoomExists
bool
RoomExists
bool
`json:"room_exists"`
// Do all the previous events exist on this roomserver?
// Do all the previous events exist on this roomserver?
// If some of previous events do not exist this will be false and StateEvents will be empty.
// If some of previous events do not exist this will be false and StateEvents will be empty.
PrevEventsExist
bool
PrevEventsExist
bool
`json:"prev_events_exist"`
// The state events requested.
// The state events requested.
// This list will be in an arbitrary order.
// This list will be in an arbitrary order.
StateEvents
[]
gomatrixserverlib
.
Event
StateEvents
[]
gomatrixserverlib
.
Event
`json:"state_events"`
}
}
// QueryEventsByIDRequest is a request to QueryEventsByID
// QueryEventsByIDRequest is a request to QueryEventsByID
type
QueryEventsByIDRequest
struct
{
type
QueryEventsByIDRequest
struct
{
// The event IDs to look up.
// The event IDs to look up.
EventIDs
[]
string
EventIDs
[]
string
`json:"event_ids"`
}
}
// QueryEventsByIDResponse is a response to QueryEventsByID
// QueryEventsByIDResponse is a response to QueryEventsByID
...
@@ -96,7 +97,7 @@ type QueryEventsByIDResponse struct {
...
@@ -96,7 +97,7 @@ type QueryEventsByIDResponse struct {
// fails to read it from the database then it will fail
// fails to read it from the database then it will fail
// the entire request.
// the entire request.
// This list will be in an arbitrary order.
// This list will be in an arbitrary order.
Events
[]
gomatrixserverlib
.
Event
Events
[]
gomatrixserverlib
.
Event
`json:"events"`
}
}
// RoomserverQueryAPI is used to query information from the room server.
// RoomserverQueryAPI is used to query information from the room server.
...
@@ -121,13 +122,13 @@ type RoomserverQueryAPI interface {
...
@@ -121,13 +122,13 @@ type RoomserverQueryAPI interface {
}
}
// RoomserverQueryLatestEventsAndStatePath is the HTTP path for the QueryLatestEventsAndState API.
// RoomserverQueryLatestEventsAndStatePath is the HTTP path for the QueryLatestEventsAndState API.
const
RoomserverQueryLatestEventsAndStatePath
=
"/api/roomserver/
Q
ueryLatestEventsAndState"
const
RoomserverQueryLatestEventsAndStatePath
=
"/api/roomserver/
q
ueryLatestEventsAndState"
// RoomserverQueryStateAfterEventsPath is the HTTP path for the QueryStateAfterEvents API.
// RoomserverQueryStateAfterEventsPath is the HTTP path for the QueryStateAfterEvents API.
const
RoomserverQueryStateAfterEventsPath
=
"/api/roomserver/
Q
ueryStateAfterEvents"
const
RoomserverQueryStateAfterEventsPath
=
"/api/roomserver/
q
ueryStateAfterEvents"
// RoomserverQueryEventsByIDPath is the HTTP path for the QueryEventsByID API.
// RoomserverQueryEventsByIDPath is the HTTP path for the QueryEventsByID API.
const
RoomserverQueryEventsByIDPath
=
"/api/roomserver/
Q
ueryEventsByID"
const
RoomserverQueryEventsByIDPath
=
"/api/roomserver/
q
ueryEventsByID"
// NewRoomserverQueryAPIHTTP creates a RoomserverQueryAPI implemented by talking to a HTTP POST API.
// NewRoomserverQueryAPIHTTP creates a RoomserverQueryAPI implemented by talking to a HTTP POST API.
// If httpClient is nil then it uses the http.DefaultClient
// If httpClient is nil then it uses the http.DefaultClient
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录