-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #110 from linkernetworks/johnlin/restful-version
add server version Former-commit-id: 266a6612a472943a93b0439525c26b1d6439b9ec [formerly 266a6612a472943a93b0439525c26b1d6439b9ec [formerly 8d8194b]] Former-commit-id: 363cd0704cecbff621d0e79e8d2f43fa2b3597ef Former-commit-id: 43180d7
- Loading branch information
Showing
4 changed files
with
29 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
package server | ||
|
||
import ( | ||
"github.com/emicklei/go-restful" | ||
"github.com/linkernetworks/vortex/src/serviceprovider" | ||
"github.com/linkernetworks/vortex/src/version" | ||
"github.com/linkernetworks/vortex/src/web" | ||
) | ||
|
||
func versionHandler(sp *serviceprovider.Container) restful.RouteFunction { | ||
return func(req *restful.Request, resp *restful.Response) { | ||
} | ||
func versionHandler(ctx *web.Context) { | ||
_, _, resp := ctx.ServiceProvider, ctx.Request, ctx.Response | ||
resp.WriteEntity(ActionResponse{ | ||
Error: false, | ||
Message: version.GetVersion(), | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package version | ||
|
||
var version string | ||
|
||
func GetVersion() string { | ||
return version | ||
} |