This repository has been archived by the owner on Jun 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove un-needed endpoints and handlers
- Loading branch information
1 parent
fe0a696
commit d6e031b
Showing
2 changed files
with
0 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,11 @@ | ||
package main | ||
|
||
import ( | ||
"context" | ||
"net/http" | ||
"strconv" | ||
|
||
"github.com/labstack/echo/v4" | ||
"github.com/labstack/gommon/log" | ||
) | ||
|
||
func index(c echo.Context) error { | ||
return c.String(http.StatusOK, "RealTime Hog 3000") | ||
} | ||
|
||
func pgVersion(c echo.Context) error { | ||
conn := getPGConn() | ||
defer conn.Close(context.Background()) | ||
|
||
var version string | ||
err := conn.QueryRow(context.Background(), "select version()").Scan(&version) | ||
if err != nil { | ||
c.Logger().Error("cannot get row: %v", err) | ||
} | ||
|
||
return c.String(http.StatusOK, version) | ||
} | ||
|
||
func getToken(c echo.Context) error { | ||
teamIdStr := c.QueryParam("teamId") | ||
teamId, err := strconv.Atoi(teamIdStr) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
token, err := tokenFromTeamId(teamId) | ||
if err != nil { | ||
log.Error("query error") | ||
return err | ||
} | ||
|
||
return c.String(http.StatusOK, token) | ||
} | ||
|
||
func getPerson(c echo.Context) error { | ||
distinctId := c.QueryParam("distinctId") | ||
|
||
personId, err := personFromDistinctId(distinctId) | ||
if err != nil { | ||
log.Error("query error") | ||
return err | ||
} | ||
|
||
return c.String(http.StatusOK, strconv.Itoa(personId)) | ||
} |
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