diff --git a/README.md b/README.md index 25bb1ee..48c8fc0 100644 --- a/README.md +++ b/README.md @@ -60,10 +60,18 @@ The client uses the following flags -ip - specify alternate server destination ``` +### How It Works +The sequence diagram can be viewed in ```diag``` folder, which shows the sequence of networked messages for each usage of ekho. +The source code is in the same folder, ```ekho-seq.txt```, and can be uploaded to [sequencediagram.org][seqdiag] to rerender the diagram and view any updates. + + ### To Be Implemented +- Multiple transactions for large quote file - Log all uses/transaction data each day - Request, send, and receive the logfile for any day - User-specific quotes/quotefiles - Installation (client-side, at least) via MOTD + [golang]: +[seqdiag]: diff --git a/diag/ekho-seq.png b/diag/ekho-seq.png new file mode 100644 index 0000000..7ddd09a Binary files /dev/null and b/diag/ekho-seq.png differ diff --git a/diag/ekho-seq.txt b/diag/ekho-seq.txt new file mode 100644 index 0000000..4a95267 --- /dev/null +++ b/diag/ekho-seq.txt @@ -0,0 +1,149 @@ +title ekho + +# declare entities +actor user +participant ekho +database server + + +# user requesting a quote of the day +==request== + +user->(1)ekho:./ekho +space -2.75 +ekho->(1)server:sr@please +space -2.75 +server-->server:grab length of quotes, N +space -2.75 +server->(1)ekho:sa@N +space -2.75 +ekho-->ekho:random number\nX ≤ N +space -2.75 +ekho->(1)server:qr@X +space -2.75 +server->(1)ekho:qa@xyz +space -2.75 +ekho->(1)server:te@success +space -2.75 +ekho->(1)user:xyz + + +# begin list sequence +==list== + +user->(1)ekho:./ekho -l +space -2.75 +ekho->(1)server:lr@dumvar +space -2.75 +server->(1)ekho:la@xyz... +space -2.75 +ekho->(1)server:te@success +space -2.75 +ekho->(1)user:xyz + + +# when list length is larger than buffer size +==list overrun== + +user->(1)ekho:./ekho -l +space -2.75 +ekho->(1)server:lr@dumvar +space -2.75 +server->(1)ekho:la@1@xyz... +space -2.75 +ekho->(1)server:lr@1 +space -2.75 +server->(1)ekho:la@2@abc... +box over ekho,server:repeat until quote\nlist is near empty +space -2.75 +ekho->(1)server:lr@n-1 +space -2.75 +server->(1)ekho:la@n@pqr... +space -2.75 +ekho->(1)server:te@success +space -2.75 +ekho->(1)user:xyz...abc...pqr + + +# user wants to add new quote to list +==add== + +user->(1)ekho:./ekho -a "xyz" +space -2.75 +ekho->(1)server:ar@xyz +space -2.75 +server->(1)ekho:aa@success +space -2.75 +ekho->(1)server:te@success +space -2.75 +ekho->(1)user:"add successful" + + +# user wants to remove quote +==remove== + +user->(1)ekho:./ekho -r +space -2.75 +ekho->(1)server:r1@dumvar +space -2.75 +server->(1)ekho:r1@xyz... +box over ekho,server:basically redo la,\nlisting all quotes +space -2.75 +ekho->(1)user:xyz...abc...pqr +space -2.75 +user->(1)ekho:X +ekho->(1)server:r2@X +space -2.75 +server->(1)ekho:r2@success +space -2.75 +ekho->(1)server:lr@dumvar +space -2.75 +server->(1)ekho:la@xyz... +box over ekho,server:literally redo la,\nlisting all quotes +ekho->(1)server:te@success +space -2.75 +ekho->(1)user:xyz...abc...pqr + + +# user wants to remove quote, knows which one +==remove (known)== + +user->(1)ekho:./ekho -r X +space -2.75 +ekho->(1)server:r2@X +space -2.75 +server->(1)ekho:r2@success +space -2.75 +ekho->(1)server:lr@dumvar +space -2.75 +server->(1)ekho:la@xyz... +box over ekho,server:literally redo la,\nlisting all quotes +ekho->(1)server:te@success +space -2.75 +ekho->(1)user:xyz...abc...pqr + + +# user wants to get receive logs (WIP lol) +==log== + +user->(1)ekho:./ekho -g +space -2.75 +ekho->(1)server:gr@dumvar +space -2.75 +server->(1)ekho:ga@1@xyz +box over ekho,server:redo LONG la using log\nfile instead of quotes +space -2.75 +ekho->(1)server:gr@n-1 +space -2.75 +server->(1)ekho:ga@n@pqr +space -2.75 +ekho->(1)server:te@success +space -2.75 +ekho->(1)user:"logs received" + + +# eventually I will need to figure out +# how to clear logs + +# delete log file +#==clear logs== \ No newline at end of file