From 065771c9bc39aa20eb0e6e227a274bdbb5d62c54 Mon Sep 17 00:00:00 2001 From: Isaac Teles-Rosario Date: Fri, 22 Apr 2022 00:21:44 -0400 Subject: [PATCH] Readme for server, needs review --- CTng/server/Readme.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 CTng/server/Readme.md diff --git a/CTng/server/Readme.md b/CTng/server/Readme.md new file mode 100644 index 0000000..7e8976c --- /dev/null +++ b/CTng/server/Readme.md @@ -0,0 +1,29 @@ +# Server Implementation + +## Contents +- `Gossiper_server.go`: implementation of gossiper server functionality (i,e start server and handling gossip object requests) +- `Monitior_server.go`: implementation of monitor server functionality (i,e start server and handling requests) +- `Logger.go`: file that represents functionality of ctng logger +- `helper.go`: contains helper functions used within several other files + +## Gossiper_server.go +- `bindContext`: binds context to functions that are passed to router +- `handleRequests`: starts http server to listen and serve requests +- `homePage`: base page of gossiper +- The remaining functions are tailored towards handling different gossip requests such as POST and GET requests. The gossiper server start function is also contained in this file. + + +## Monitor_server.go +- Contains Get functions for: `STH, Revocation(s), and POM`. +- Receive functions for: `Gossip(object) and POM`. +- Handle functions for: `Gossip` +- After running `StartMonitorServer` the monitor will listen for requests by running `handleMonitorRequests`, then it runs the respective functions to handle the types of request listed above. + +## Logger.go +- This file represents the functionality of a CTng logger. Currently we use a fakelogger but this file is the skeleton for what a logger in CTng should look like. + + +## helpers.go +- `gossipIDFromParams`: Gets and returns the Gossip_object_ID if it's valid, error if not. Gossip_object_ID is a struct which contains the values: application, type, signer, and period of a gossip object. +- `getSenderURL`: This gets and returns the senderURL, we use this in several functions to show where objects come from (valid, invalid, dups). +- `isOwner`: Boolean function that returns true if the ownerURL matches the parsedURL, false if not. This is used in Gossip_server to verify if the sender is an owner.