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
|
package router
import (
dnsController "dove/controllers/dns"
domainController "dove/controllers/domain"
domainPage "dove/pages/domain"
"dove/utils/auth"
"dove/utils/urls"
)
func init() {
urls.SetNamespace("domains")
urls.Path(urls.Get, "/", auth.RequireAuthentication(domainPage.Index), "index")
urls.Path(urls.Get, "/tlds", auth.RequireAuthentication(domainPage.TLDs), "tlds")
urls.Path(urls.Get, "/tlds/new", auth.RequireAuthentication(domainPage.NewTLD), "tlds.new")
urls.Path(urls.Post, "/tlds", auth.RequireAuthentication(domainController.CreateTLD), "tlds.create")
urls.Path(urls.Get, "/tlds/:id/edit", auth.RequireAuthentication(domainPage.EditTLD), "tlds.edit")
urls.Path(urls.Put, "/tlds/:id", auth.RequireAuthentication(domainController.UpdateTLD), "tlds.update")
urls.Path(urls.Delete, "/tlds/:name", auth.RequireAuthentication(domainController.DeleteTLD), "tlds.delete")
urls.Path(urls.Get, "/manage", auth.RequireAuthentication(domainPage.Domains), "manage")
urls.Path(urls.Get, "/manage/new", auth.RequireAuthentication(domainPage.NewDomain), "manage.new")
urls.Path(urls.Post, "/manage", auth.RequireAuthentication(domainController.CreateDomain), "manage.create")
urls.Path(urls.Delete, "/manage/:id", auth.RequireAuthentication(domainController.DeleteDomain), "manage.delete")
urls.Path(urls.Get, "/manage/:id", auth.RequireAuthentication(domainPage.DomainDetail), "manage.detail")
urls.Path(urls.Post, "/records", auth.RequireAuthentication(dnsController.CreateRecord), "records.create")
urls.Path(urls.Put, "/records/:type/:id", auth.RequireAuthentication(dnsController.UpdateRecord), "records.update")
urls.Path(urls.Delete, "/records/:type/:id", auth.RequireAuthentication(dnsController.DeleteRecord), "records.delete")
}
|