Update endpoint comments
parent
be62fc939a
commit
6a7aafbff4
|
@ -23,7 +23,7 @@ const (
|
||||||
|
|
||||||
var isValidUsername = regexp.MustCompile(`^\w{1,16}$`).MatchString
|
var isValidUsername = regexp.MustCompile(`^\w{1,16}$`).MatchString
|
||||||
|
|
||||||
// /api/account/info - get account info
|
// /account/info - get account info
|
||||||
|
|
||||||
type AccountInfoResponse struct{
|
type AccountInfoResponse struct{
|
||||||
Username string `json:"string"`
|
Username string `json:"string"`
|
||||||
|
@ -61,7 +61,7 @@ func (s *Server) HandleAccountInfo(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Write(response)
|
w.Write(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
// /api/account/register - register account
|
// /account/register - register account
|
||||||
|
|
||||||
type AccountRegisterRequest GenericAuthRequest
|
type AccountRegisterRequest GenericAuthRequest
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ func (s *Server) HandleAccountRegister(w http.ResponseWriter, r *http.Request) {
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
// /api/account/login - log into account
|
// /account/login - log into account
|
||||||
|
|
||||||
type AccountLoginRequest GenericAuthRequest
|
type AccountLoginRequest GenericAuthRequest
|
||||||
type AccountLoginResponse GenericAuthResponse
|
type AccountLoginResponse GenericAuthResponse
|
||||||
|
@ -170,7 +170,7 @@ func (s *Server) HandleAccountLogin(w http.ResponseWriter, r *http.Request) {
|
||||||
w.Write(response)
|
w.Write(response)
|
||||||
}
|
}
|
||||||
|
|
||||||
// /api/account/logout - log out of account
|
// /account/logout - log out of account
|
||||||
|
|
||||||
func (s *Server) HandleAccountLogout(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) HandleAccountLogout(w http.ResponseWriter, r *http.Request) {
|
||||||
token, err := base64.StdEncoding.DecodeString(r.Header.Get("Authorization"))
|
token, err := base64.StdEncoding.DecodeString(r.Header.Get("Authorization"))
|
||||||
|
|
|
@ -2,7 +2,7 @@ package api
|
||||||
|
|
||||||
import "net/http"
|
import "net/http"
|
||||||
|
|
||||||
// /api/savedata/get - get save data
|
// /savedata/get - get save data
|
||||||
|
|
||||||
type SavedataGetRequest struct{}
|
type SavedataGetRequest struct{}
|
||||||
type SavedataGetResponse struct{}
|
type SavedataGetResponse struct{}
|
||||||
|
@ -11,7 +11,7 @@ func (s *Server) HandleSavedataGet(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// /api/savedata/update - update save data
|
// /savedata/update - update save data
|
||||||
|
|
||||||
type SavedataUpdateRequest struct{}
|
type SavedataUpdateRequest struct{}
|
||||||
type SavedataUpdateResponse struct{}
|
type SavedataUpdateResponse struct{}
|
||||||
|
@ -20,7 +20,7 @@ func (s *Server) HandleSavedataUpdate(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// /api/savedata/delete - delete save date
|
// /savedata/delete - delete save date
|
||||||
|
|
||||||
type SavedataDeleteRequest struct{}
|
type SavedataDeleteRequest struct{}
|
||||||
type SavedataDeleteResponse struct{}
|
type SavedataDeleteResponse struct{}
|
||||||
|
|
Loading…
Reference in New Issue