2017-06-14 20:13:30 +00:00
|
|
|
package main
|
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
var tests = map[string][]string{
|
2017-06-14 20:13:30 +00:00
|
|
|
// User
|
2017-06-21 18:33:57 +00:00
|
|
|
"/user/:nick": []string{
|
2017-06-14 20:13:30 +00:00
|
|
|
"/+Akyoto",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-14 20:13:30 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/user/:nick/threads": []string{
|
2017-06-14 20:13:30 +00:00
|
|
|
"/+Akyoto/threads",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-14 20:13:30 +00:00
|
|
|
|
2017-06-23 15:15:48 +00:00
|
|
|
"/user/:nick/posts": []string{
|
|
|
|
"/+Akyoto/posts",
|
|
|
|
},
|
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/user/:nick/animelist": []string{
|
2017-06-20 12:16:23 +00:00
|
|
|
"/+Akyoto/animelist",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-20 12:16:23 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/user/:nick/animelist/:id": []string{
|
2017-06-20 12:16:23 +00:00
|
|
|
"/+Akyoto/animelist/7929",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-20 12:16:23 +00:00
|
|
|
|
2017-06-14 20:13:30 +00:00
|
|
|
// Pages
|
2017-06-21 18:33:57 +00:00
|
|
|
"/anime/:id": []string{
|
2017-06-14 20:13:30 +00:00
|
|
|
"/anime/1",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-14 20:13:30 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/threads/:id": []string{
|
2017-06-14 20:13:30 +00:00
|
|
|
"/threads/HJgS7c2K",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-14 20:13:30 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/posts/:id": []string{
|
2017-06-14 20:13:30 +00:00
|
|
|
"/posts/B1RzshnK",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-14 20:13:30 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/forum/:tag": []string{
|
2017-06-14 20:13:30 +00:00
|
|
|
"/forum/general",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-14 20:13:30 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/search/:term": []string{
|
2017-06-21 00:02:30 +00:00
|
|
|
"/search/Dragon Ball",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-21 00:02:30 +00:00
|
|
|
|
2017-06-14 20:13:30 +00:00
|
|
|
// API
|
2017-06-21 18:33:57 +00:00
|
|
|
"/api/anime/:id": []string{
|
2017-06-14 20:13:30 +00:00
|
|
|
"/api/anime/1",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-14 20:13:30 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/api/thread/:id": []string{
|
2017-06-14 20:13:30 +00:00
|
|
|
"/api/thread/HJgS7c2K",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-14 20:13:30 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/api/post/:id": []string{
|
2017-06-14 20:13:30 +00:00
|
|
|
"/api/post/B1RzshnK",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-14 20:13:30 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/api/animelist/:id": []string{
|
2017-06-14 20:13:30 +00:00
|
|
|
"/api/animelist/4J6qpK1ve",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-14 20:13:30 +00:00
|
|
|
|
2017-06-23 15:15:48 +00:00
|
|
|
"/api/animelist/:id/get/:item": []string{
|
|
|
|
"/api/animelist/4J6qpK1ve/get/7929",
|
|
|
|
},
|
|
|
|
|
|
|
|
"/api/animelist/:id/get/:item/:property": []string{
|
|
|
|
"/api/animelist/4J6qpK1ve/get/7929/Episodes",
|
|
|
|
},
|
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/api/settings/:id": []string{
|
2017-06-14 20:13:30 +00:00
|
|
|
"/api/settings/4J6qpK1ve",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-14 20:13:30 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/api/user/:id": []string{
|
2017-06-14 20:13:30 +00:00
|
|
|
"/api/user/4J6qpK1ve",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-14 20:13:30 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/api/emailtouser/:id": []string{
|
2017-06-16 22:33:27 +00:00
|
|
|
"/api/emailtouser/e.urbach@gmail.com",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-16 22:33:27 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/api/googletouser/:id": []string{
|
2017-06-16 22:33:27 +00:00
|
|
|
"/api/googletouser/106530160120373282283",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-16 22:33:27 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/api/nicktouser/:id": []string{
|
2017-06-16 22:33:27 +00:00
|
|
|
"/api/nicktouser/Akyoto",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-16 22:33:27 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/api/searchindex/:id": []string{
|
2017-06-21 00:02:30 +00:00
|
|
|
"/api/searchindex/Anime",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-21 00:02:30 +00:00
|
|
|
|
2017-06-16 22:33:27 +00:00
|
|
|
// Images
|
2017-06-21 18:33:57 +00:00
|
|
|
"/images/avatars/large/:file": []string{
|
2017-06-18 12:52:50 +00:00
|
|
|
"/images/avatars/large/4J6qpK1ve.webp",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-18 12:52:50 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/images/avatars/small/:file": []string{
|
2017-06-18 12:52:50 +00:00
|
|
|
"/images/avatars/small/4J6qpK1ve.webp",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-18 12:52:50 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/images/brand/:file": []string{
|
2017-06-18 12:52:50 +00:00
|
|
|
"/images/brand/64.webp",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-16 22:33:27 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/images/login/:file": []string{
|
2017-06-16 22:33:27 +00:00
|
|
|
"/images/login/google",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-16 22:33:27 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/images/cover/:file": []string{
|
2017-06-14 20:13:30 +00:00
|
|
|
"/images/cover/default",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-14 20:13:30 +00:00
|
|
|
|
2017-06-21 18:33:57 +00:00
|
|
|
"/images/elements/:file": []string{
|
2017-06-18 12:07:38 +00:00
|
|
|
"/images/elements/no-avatar.svg",
|
2017-06-21 18:33:57 +00:00
|
|
|
},
|
2017-06-14 20:13:30 +00:00
|
|
|
|
|
|
|
// Disable
|
2017-06-21 18:33:57 +00:00
|
|
|
"/auth/google": nil,
|
|
|
|
"/auth/google/callback": nil,
|
2017-06-27 10:46:56 +00:00
|
|
|
"/new/thread": nil,
|
2017-06-27 21:33:21 +00:00
|
|
|
"/new/soundtrack": nil,
|
2017-06-21 18:33:57 +00:00
|
|
|
"/user": nil,
|
|
|
|
"/settings": nil,
|
2017-06-25 09:58:18 +00:00
|
|
|
"/extension/embed": nil,
|
2017-06-21 18:33:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
// Specify test routes
|
|
|
|
for route, examples := range tests {
|
|
|
|
app.Test(route, examples)
|
|
|
|
}
|
2017-06-14 20:13:30 +00:00
|
|
|
}
|