readme and config updates

This commit is contained in:
0ceanSlim 2024-07-23 11:07:43 -04:00
parent ef0f7a78dd
commit 567f6ec289
3 changed files with 2 additions and 5 deletions

View File

@ -1,8 +1,5 @@
mongodb: mongodb:
uri: "mongodb://localhost:27017/" uri: "mongodb://localhost:27017/"
database: "grain" database: "grain"
collections:
event_kind0: "event-kind0"
event_kind1: "event-kind1"
server: server:
address: ":8080" address: ":8080"

View File

@ -29,7 +29,6 @@ cp config.example.yml config.yml
### TODO ### TODO
- merge event and db package into server package.
- Handle more kinds - Handle more kinds
- create whitelist/blacklist functionality - create whitelist/blacklist functionality
for: for:

View File

@ -81,7 +81,7 @@ func handleEvent(ws *websocket.Conn, message []interface{}) {
return return
} }
// Call the HandleKind function from the events package // Call the HandleKind function
HandleKind(context.TODO(), evt, ws) HandleKind(context.TODO(), evt, ws)
fmt.Println("Event processed:", evt.ID) fmt.Println("Event processed:", evt.ID)
@ -155,6 +155,7 @@ func handleReq(ws *websocket.Conn, message []interface{}) {
fmt.Println("Subscription added:", subID) fmt.Println("Subscription added:", subID)
// Query the database with filters and send back the results // Query the database with filters and send back the results
// TO DO why is this taking a certain kind as an argument for collection???
queriedEvents, err := QueryEvents(filters, db.GetClient(), "grain", "event-kind1") queriedEvents, err := QueryEvents(filters, db.GetClient(), "grain", "event-kind1")
if err != nil { if err != nil {
fmt.Println("Error querying events:", err) fmt.Println("Error querying events:", err)