-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathurl.go
73 lines (58 loc) · 2.11 KB
/
url.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
65
66
67
68
69
70
71
72
73
package pritunl
import "fmt"
// getServerSettingsPath 服务配置获取url
func getServerSettingsPath() string {
return "/settings"
}
// getAdminListPath 获取管理员列表url
func getAdminListPath() string {
return "/admin"
}
// getUpdateAdminUserPath 获取更新管理员配置的url
func getUpdateAdminUserPath(userId string) string {
return fmt.Sprintf("/admin/%s", userId)
}
// getCreateServerPath 获取创建vpn server的url
func getCreateServerPath() string {
return "/server"
}
// getOrganizationList 获取组织列表url
func getOrganizationList() string {
return "/organization"
}
// getAttachOrganizationUrl 获取添加组织url
func getAttachOrganizationUrl(serverId, organizationId string) string {
return fmt.Sprintf("/server/%s/organization/%s", serverId, organizationId)
}
// getServerRoutesUrl 获取vpn server路由列表url
func getServerRoutesUrl(serverId string) string {
return fmt.Sprintf("/server/%s/route", serverId)
}
// getDeleteRouteUrl 获取删除路由的url
func getDeleteRouteUrl(serverId, routeId string) string {
return fmt.Sprintf("/server/%s/route/%s", serverId, routeId)
}
// getAddRouteUrl 获取添加路由的url
func getAddRouteUrl(serverId string) string {
return fmt.Sprintf("/server/%s/route", serverId)
}
// getUpdateRouteUrl 获取更新路由的url
func getUpdateRouteUrl(serverId, routeId string) string {
return fmt.Sprintf("/server/%s/route/%s", serverId, routeId)
}
// getAddUserUrl 获取添加用户的url
func getAddUserUrl(organizationId string) string {
return fmt.Sprintf("/user/%s", organizationId)
}
// getUpdateUserUrl 获取更新用户的url
func getUpdateUserUrl(organizationId, userId string) string {
return fmt.Sprintf("/user/%s/%s", organizationId, userId)
}
// getServerStartStopUrl 获取vpn server启动停止url
func getServerStartStopUrl(serverId, operation string) string {
return fmt.Sprintf("/server/%s/operation/%s", serverId, operation)
}
// getExportConnectFileUrl 获取导出用户连接配置文件的url
func getExportConnectFileUrl(organizationId, userId string) string {
return fmt.Sprintf("/key/%s/%s.tar", organizationId, userId)
}