This repository was archived by the owner on Sep 2, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathmedia.rs
More file actions
49 lines (36 loc) · 1.28 KB
/
media.rs
File metadata and controls
49 lines (36 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Endpoints for content.
use iron::{Chain, Handler, IronError, IronResult, Request, Response};
use error::ApiError;
use middleware::{AccessTokenAuth, MiddlewareChain};
/// The `/download/:server_name/:media_id` endpoint.
pub struct Download;
middleware_chain!(Download, [AccessTokenAuth]);
impl Handler for Download {
fn handle(&self, _: &mut Request) -> IronResult<Response> {
Err(IronError::from(ApiError::unimplemented(None)))
}
}
/// The `/download/:server_name/:media_id/:file_name` endpoint.
pub struct DownloadFile;
middleware_chain!(DownloadFile, [AccessTokenAuth]);
impl Handler for DownloadFile {
fn handle(&self, _: &mut Request) -> IronResult<Response> {
Err(IronError::from(ApiError::unimplemented(None)))
}
}
/// The `/upload` endpoint.
pub struct Upload;
middleware_chain!(Upload, [AccessTokenAuth]);
impl Handler for Upload {
fn handle(&self, _: &mut Request) -> IronResult<Response> {
Err(IronError::from(ApiError::unimplemented(None)))
}
}
/// The `/thumbnail/:server_name/:media_id` endpoint.
pub struct Thumbnail;
middleware_chain!(Thumbnail, [AccessTokenAuth]);
impl Handler for Thumbnail {
fn handle(&self, _: &mut Request) -> IronResult<Response> {
Err(IronError::from(ApiError::unimplemented(None)))
}
}