module
Version:
v0.0.0-...-b4f6b1b
Opens a new window with list of versions in this module.
Published: Aug 26, 2019
License: MIT
Opens a new window with license information.
README
¶
Signup
Endpoints
POST /signup/{email_address}
- Generate random verification code
XXXXXX
- Check that code does not already exist in database. If it does exist, GOTO (1), else GOTO (3).
- Send email to
email_address
containing link to /verify/XXXXXX
- Store in database the row
creation_date: time.Now(), email: email_address, code: XXXXXX, is_verified: false
- Response JSON:
{"Address": "email_address", "Success": true, "Note": ""}
GET /signup/{email_address}
- Check
email_address
in database and verified = true
- Response JSON:
{"Address": "email_address", "Success": true, "Note": ""}
GET /verify/{code}
- Look up
code = XXXXXX
in database. If XXXXXX
exists, GOTO 2, else GOTO 3.
- If
is_verified: false
GOTO 4, else GOTO 5
- Response JSON:
{"Code": "XXXXXX", "Success": false, "Note": "no such verification code"}
- Mark
is_verified
as true
in database, GOTO 6
- Response JSON:
{"Code": "XXXXXX", "Success": false, "Note": "signup already verified"}
- Response JSON:
{"Code": "XXXXXX", "Success": true, "Note": ""}
Notes
I found this incredibly useful in helping me design testable code using Google App Engine:
https://www.compoundtheory.com/testing-go-http-handlers-in-google-app-engine-with-mux-and-higher-order-functions/
Directories
¶
Click to show internal directories.
Click to hide internal directories.