Standardise function names (Ping -> PingGET, SurpriseMe -> SurpriseMeGET)

This commit is contained in:
Howl 2016-04-04 14:36:37 +02:00
parent 6bae1e2390
commit 851c90764a
2 changed files with 6 additions and 6 deletions

View File

@ -19,8 +19,8 @@ func Start(conf common.Conf, db *sql.DB) {
gv1 := api.Group("/v1")
{
// Auth-free API endpoints
gv1.GET("/ping", Method(v1.Ping, db))
gv1.GET("/surprise_me", Method(v1.SurpriseMe, db))
gv1.GET("/ping", Method(v1.PingGET, db))
gv1.GET("/surprise_me", Method(v1.SurpriseMeGET, db))
gv1.GET("/privileges", Method(v1.PrivilegesGET, db))
// Read privilege required

View File

@ -87,8 +87,8 @@ type pingData struct {
Privileges int `json:"privileges"`
}
// Ping is a message to check with the API that we are logged in, and know what are our privileges.
func Ping(md common.MethodData) (r common.Response) {
// PingGET is a message to check with the API that we are logged in, and know what are our privileges.
func PingGET(md common.MethodData) (r common.Response) {
r.Code = 200
if md.User.UserID == 0 {
r.Message = "You have not given us a token, so we don't know who you are! But you can still login with /api/v1/login " + kaomojis[rn.Intn(len(kaomojis))]
@ -102,10 +102,10 @@ func Ping(md common.MethodData) (r common.Response) {
return
}
// SurpriseMe generates cute cats.
// SurpriseMeGET generates cute cats.
//
// ... Yes.
func SurpriseMe(md common.MethodData) (r common.Response) {
func SurpriseMeGET(md common.MethodData) (r common.Response) {
r.Code = 200
cats := make([]string, 100)
for i := 0; i < 100; i++ {