Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tfn18001 committed Apr 22, 2022
2 parents 6e4cca9 + 9652186 commit 8916906
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions CTng/server/Readme.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 8916906

Please sign in to comment.