Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
973b9cad
Commit
973b9cad
authored
Dec 15, 2014
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved all http route handling into single package named api
parent
1663cbbb
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
21 additions
and
23 deletions
+21
-23
pkg/api/api.go
+14
-16
pkg/api/api_account.go
+1
-1
pkg/api/api_dashboard.go
+1
-1
pkg/api/api_login.go
+2
-2
pkg/api/api_login_oauth.go
+1
-1
pkg/api/api_register.go
+0
-0
pkg/api/api_render.go
+0
-0
pkg/api/dtos/commands.go
+0
-0
pkg/api/dtos/models.go
+0
-0
pkg/cmd/web.go
+2
-2
No files found.
pkg/
routes/index
.go
→
pkg/
api/api
.go
View file @
973b9cad
package
routes
package
api
import
(
"github.com/Unknwon/macaron"
"github.com/torkelo/grafana-pro/pkg/api/dtos"
"github.com/torkelo/grafana-pro/pkg/middleware"
"github.com/torkelo/grafana-pro/pkg/routes/api"
"github.com/torkelo/grafana-pro/pkg/routes/dtos"
"github.com/torkelo/grafana-pro/pkg/routes/login"
)
func
Register
(
m
*
macaron
.
Macaron
)
{
...
...
@@ -13,32 +11,32 @@ func Register(m *macaron.Macaron) {
// index
m
.
Get
(
"/"
,
auth
,
Index
)
m
.
Post
(
"/logout"
,
login
.
LogoutPost
)
m
.
Post
(
"/login"
,
login
.
LoginPost
)
m
.
Post
(
"/logout"
,
LogoutPost
)
m
.
Post
(
"/login"
,
LoginPost
)
// login
m
.
Get
(
"/login"
,
Index
)
m
.
Get
(
"/login/:name"
,
login
.
OAuthLogin
)
m
.
Get
(
"/login/:name"
,
OAuthLogin
)
// account
m
.
Get
(
"/account/"
,
auth
,
Index
)
m
.
Get
(
"/api/account/"
,
auth
,
api
.
GetAccount
)
m
.
Post
(
"/api/account/collaborators/add"
,
auth
,
api
.
AddCollaborator
)
m
.
Get
(
"/api/account/others"
,
auth
,
api
.
GetOtherAccounts
)
m
.
Get
(
"/api/account/"
,
auth
,
GetAccount
)
m
.
Post
(
"/api/account/collaborators/add"
,
auth
,
AddCollaborator
)
m
.
Get
(
"/api/account/others"
,
auth
,
GetOtherAccounts
)
// user register
m
.
Get
(
"/register/*_"
,
Index
)
m
.
Post
(
"/api/account"
,
api
.
CreateAccount
)
m
.
Post
(
"/api/account"
,
CreateAccount
)
// dashboards
m
.
Get
(
"/dashboard/*"
,
auth
,
Index
)
m
.
Get
(
"/api/dashboards/:slug"
,
auth
,
api
.
GetDashboard
)
m
.
Get
(
"/api/search/"
,
auth
,
api
.
Search
)
m
.
Post
(
"/api/dashboard/"
,
auth
,
api
.
PostDashboard
)
m
.
Delete
(
"/api/dashboard/:slug"
,
auth
,
api
.
DeleteDashboard
)
m
.
Get
(
"/api/dashboards/:slug"
,
auth
,
GetDashboard
)
m
.
Get
(
"/api/search/"
,
auth
,
Search
)
m
.
Post
(
"/api/dashboard/"
,
auth
,
PostDashboard
)
m
.
Delete
(
"/api/dashboard/:slug"
,
auth
,
DeleteDashboard
)
// rendering
m
.
Get
(
"/render/*"
,
auth
,
api
.
RenderToPng
)
m
.
Get
(
"/render/*"
,
auth
,
RenderToPng
)
}
func
Index
(
ctx
*
middleware
.
Context
)
{
...
...
pkg/
routes/
api/api_account.go
→
pkg/api/api_account.go
View file @
973b9cad
package
api
import
(
"github.com/torkelo/grafana-pro/pkg/api/dtos"
"github.com/torkelo/grafana-pro/pkg/middleware"
"github.com/torkelo/grafana-pro/pkg/models"
"github.com/torkelo/grafana-pro/pkg/routes/dtos"
"github.com/torkelo/grafana-pro/pkg/utils"
)
...
...
pkg/
routes/
api/api_dashboard.go
→
pkg/api/api_dashboard.go
View file @
973b9cad
package
api
import
(
"github.com/torkelo/grafana-pro/pkg/api/dtos"
"github.com/torkelo/grafana-pro/pkg/middleware"
"github.com/torkelo/grafana-pro/pkg/models"
"github.com/torkelo/grafana-pro/pkg/routes/dtos"
"github.com/torkelo/grafana-pro/pkg/utils"
)
...
...
pkg/
routes/login/
login.go
→
pkg/
api/api_
login.go
View file @
973b9cad
package
login
package
api
import
(
"github.com/torkelo/grafana-pro/pkg/api/dtos"
"github.com/torkelo/grafana-pro/pkg/log"
"github.com/torkelo/grafana-pro/pkg/middleware"
"github.com/torkelo/grafana-pro/pkg/models"
"github.com/torkelo/grafana-pro/pkg/routes/dtos"
"github.com/torkelo/grafana-pro/pkg/utils"
)
...
...
pkg/
routes/login/
login_oauth.go
→
pkg/
api/api_
login_oauth.go
View file @
973b9cad
package
login
package
api
import
(
"errors"
...
...
pkg/
routes/
api/api_register.go
→
pkg/api/api_register.go
View file @
973b9cad
File moved
pkg/
routes/
api/api_render.go
→
pkg/api/api_render.go
View file @
973b9cad
File moved
pkg/
routes
/dtos/commands.go
→
pkg/
api
/dtos/commands.go
View file @
973b9cad
File moved
pkg/
routes
/dtos/models.go
→
pkg/
api
/dtos/models.go
View file @
973b9cad
File moved
pkg/cmd/web.go
View file @
973b9cad
...
...
@@ -12,9 +12,9 @@ import (
"github.com/codegangsta/cli"
"github.com/macaron-contrib/session"
"github.com/torkelo/grafana-pro/pkg/api"
"github.com/torkelo/grafana-pro/pkg/log"
"github.com/torkelo/grafana-pro/pkg/middleware"
"github.com/torkelo/grafana-pro/pkg/routes"
"github.com/torkelo/grafana-pro/pkg/setting"
"github.com/torkelo/grafana-pro/pkg/social"
"github.com/torkelo/grafana-pro/pkg/stores/sqlstore"
...
...
@@ -78,7 +78,7 @@ func runWeb(*cli.Context) {
}
m
:=
newMacaron
()
routes
.
Register
(
m
)
api
.
Register
(
m
)
var
err
error
listenAddr
:=
fmt
.
Sprintf
(
"%s:%s"
,
setting
.
HttpAddr
,
setting
.
HttpPort
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment