overview-note.txt (1584B)
1 *s*: curl / Simple (raw text instructions) 2 *w*: web (template) 3 4 RootHandler: 5 GET: 6 s: instructions on how to use the server (with curl) 7 w: upload page 8 POST: 9 - Generate a random (unguessable) shot key. 10 - Pour() 11 - Return success or error page based on result 12 13 14 15 16 KeyHandler (/{shotKey}: 17 GET: 18 If exists: 19 Return data directly from DB and increase numdls. 20 Delete if limit is reached. 21 If not: 22 s: 404 or "this key is available" 23 w: upload page with post destination as /{shotKey} 24 25 POST: 26 If already exists: 27 s: return a 'unavailable key' info message 28 w: 'unavailable key' error page 29 Otherwise: Pour() 30 Process the form data, just like in RootHandler, but use the 31 requested key instead of a random one. Return success page 32 33 DELETE: MAYBE LATER (must generate a delete code etc) 34 35 Pour() 36 - multipart form data with 37 * text OR file 38 * numdls: number of dls before delete (0 for inf?, 1 default) 39 * LATER: expiration (unix milli time? or parse on server?) 40 * LATER: password 41 - Reads the Content-Disposition of text or file data and 42 stores the contents in db along with some metadata 43 44 Three bbolt buckets: 45 - data 46 - numdls 47 - limitdls 48 49 or use nested buckets, so that key maps to a bucket that contains keys: 50 data 51 limitdls 52 numdls 53 54 I think the latter is more optimal 55 56 57 58 === for curl client: 59 60 add functionality for posting links (just wrap the link in a meta tag)