forked from vmware-archive/atc
/
routes.go
64 lines (52 loc) · 2.43 KB
/
routes.go
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package web
import "github.com/tedsuo/rata"
const (
Index = "Index"
RobotsTxt = "RobotsTxt"
Pipeline = "Pipeline"
GetBuild = "GetBuild"
GetBuilds = "GetBuilds"
GetJoblessBuild = "GetJoblessBuild"
Public = "Public"
GetResource = "GetResource"
GetJob = "GetJob"
LogIn = "LogIn"
TeamLogIn = "TeamLogIn"
ProcessBasicAuthLogIn = "ProcessBasicAuthLogIn"
// so links don't break
MainPipeline = "MainPipeline"
MainGetJob = "MainGetJob"
MainGetResource = "MainGetResource"
MainGetBuild = "MainGetBuild"
)
var Routes = rata.Routes{
// public
{Path: "/", Method: "GET", Name: Index},
{Path: "/robots.txt", Method: "GET", Name: RobotsTxt},
// --- delete from here down
{Path: "/teams/:team_name/pipelines/:pipeline", Method: "GET", Name: Pipeline},
{Path: "/teams/:team_name/pipelines/:pipeline_name/jobs/:job", Method: "GET", Name: GetJob},
{Path: "/teams/:team_name/pipelines/:pipeline_name/resources/:resource", Method: "GET", Name: GetResource},
{Path: "/public/:filename", Method: "GET", Name: Public},
{Path: "/public/fonts/:filename", Method: "GET", Name: Public},
{Path: "/public/favicons/:filename", Method: "GET", Name: Public},
{Path: "/public/images/:filename", Method: "GET", Name: Public},
// public jobs only
{Path: "/teams/:team_name/pipelines/:pipeline_name/jobs/:job/builds/:build", Method: "GET", Name: GetBuild},
{Path: "/pipelines/:pipeline_name/jobs/:job/builds/:build", Method: "GET", Name: MainGetBuild},
// private
{Path: "/builds", Method: "GET", Name: GetBuilds},
{Path: "/builds/:build_id", Method: "GET", Name: GetJoblessBuild},
// auth
{Path: "/login", Method: "GET", Name: LogIn},
{Path: "/teams/:team_name/login", Method: "GET", Name: TeamLogIn},
{Path: "/teams/:team_name/login", Method: "POST", Name: ProcessBasicAuthLogIn},
// private
{Path: "/builds", Method: "GET", Name: GetBuilds},
{Path: "/builds/:build_id", Method: "GET", Name: GetJoblessBuild},
//probably leave these in, but remove the above eventually
{Path: "/pipelines/:pipeline", Method: "GET", Name: MainPipeline},
{Path: "/pipelines/:pipeline_name/jobs/:job", Method: "GET", Name: MainGetJob},
{Path: "/pipelines/:pipeline_name/resources/:resource", Method: "GET", Name: MainGetResource},
{Path: "/pipelines/:pipeline_name/jobs/:job/builds/:build", Method: "GET", Name: MainGetBuild},
}