Exemplo n.º 1
0
func init() {

	//Get All Projects (Admin Only), All My Projects for others
	router.Register("/rest/project", router.GET, nil, nil, getAllProjects)

	//Get Project (TODO Permission if only if the user has access or is admin)
	router.Register("/rest/project/{project_id}", router.GET, nil, nil, getProject)

	//Update Project (TODO Permission if only if the user has access or is admin)
	router.Register("/rest/project", router.POST, []string{"application/json"}, nil, updateProject)
}
Exemplo n.º 2
0
func init() {
	//Get All Users (Admin Only)
	router.Register("/rest/user/", router.GET, nil, nil, getUsers)

	//Register User
	router.Register("/rest/user/", router.PUT, []string{"application/json"}, nil, registerUser)

	//Get One User (Admin Only)
	//router.Register("/rest/user/{user_id}/", router.GET, nil, nil, getUser)

	//Update User (Admin Only)
	//router.Register("/rest/user/", router.PUT, []string{"application/json"}, nil, updateUser)

	// Get Me  --TODO
	// Change Password --TODO
}
Exemplo n.º 3
0
func init() {
	router.Register("/rest/subscription/{project_id}", router.GET, nil, nil, getSubscriptions)
	router.Register("/rest/subscription/{project_id}/{subscription_id}", router.GET, nil, nil, getSubscription)
	router.Register("/rest/subscription/{project_id}", router.POST, []string{"application/json"}, nil, postSubscription)
}
Exemplo n.º 4
0
func init() {
	router.Register("/rest/internal/check/{project_id}", router.POST, nil, nil, checkProject)
}
Exemplo n.º 5
0
func init() {
	router.Register("/rest/alert/{project_id}", router.GET, nil, nil, getAlerts)
	router.Register("/rest/alert/{project_id}/{alert_id}", router.GET, nil, nil, getAlert)
	router.Register("/rest/alert/{project_id}", router.POST, []string{"application/json"}, nil, postAlert)
}
Exemplo n.º 6
0
func init() {
	router.Register("/rest/internal/tick/", router.GET, nil, nil, getTick)
}