mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-15 05:32:25 +03:00
Define component interfaces based on consumers (1/2) (#2423)
* Specify interfaces used by appservice, do half of clientapi * convert more deps of clientapi to finer-grained interfaces * Convert mediaapi and rest of clientapi * Somehow this got missed
This commit is contained in:
parent
d9e71b93b6
commit
506de4bb3d
57 changed files with 414 additions and 372 deletions
|
@ -31,7 +31,7 @@ type uploadKeysRequest struct {
|
|||
OneTimeKeys map[string]json.RawMessage `json:"one_time_keys"`
|
||||
}
|
||||
|
||||
func UploadKeys(req *http.Request, keyAPI api.KeyInternalAPI, device *userapi.Device) util.JSONResponse {
|
||||
func UploadKeys(req *http.Request, keyAPI api.ClientKeyAPI, device *userapi.Device) util.JSONResponse {
|
||||
var r uploadKeysRequest
|
||||
resErr := httputil.UnmarshalJSONRequest(req, &r)
|
||||
if resErr != nil {
|
||||
|
@ -100,7 +100,7 @@ func (r *queryKeysRequest) GetTimeout() time.Duration {
|
|||
return time.Duration(r.Timeout) * time.Millisecond
|
||||
}
|
||||
|
||||
func QueryKeys(req *http.Request, keyAPI api.KeyInternalAPI, device *userapi.Device) util.JSONResponse {
|
||||
func QueryKeys(req *http.Request, keyAPI api.ClientKeyAPI, device *userapi.Device) util.JSONResponse {
|
||||
var r queryKeysRequest
|
||||
resErr := httputil.UnmarshalJSONRequest(req, &r)
|
||||
if resErr != nil {
|
||||
|
@ -138,7 +138,7 @@ func (r *claimKeysRequest) GetTimeout() time.Duration {
|
|||
return time.Duration(r.TimeoutMS) * time.Millisecond
|
||||
}
|
||||
|
||||
func ClaimKeys(req *http.Request, keyAPI api.KeyInternalAPI) util.JSONResponse {
|
||||
func ClaimKeys(req *http.Request, keyAPI api.ClientKeyAPI) util.JSONResponse {
|
||||
var r claimKeysRequest
|
||||
resErr := httputil.UnmarshalJSONRequest(req, &r)
|
||||
if resErr != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue