Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

markdown lint issues, spelling issues and other small fixes #2

Merged
merged 2 commits into from
Mar 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 34 additions & 35 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ Contributing to Argus Engine is pretty straightforward

## Contributing to building ARGUS Client Libraries ( Langauge Specific )

Building ARGUS client libraries invloves 3 straight simple steps.
Building ARGUS client libraries involves 3 simple steps.

- Connecting to ARGUS Engine
- Authenticating the connection
- Listening for events and messages
Expand All @@ -21,7 +22,7 @@ A simple TCP/IP dial/connect to the IP and Port is enough to do the trick.

```go
import (
"net"
"net"
)
conn, err := net.Dial("tcp", "localhost:1337")

Expand All @@ -46,7 +47,7 @@ If authentication is turned on from the ARGUS Engine, it means clients connectin

The client has to send a prompt message to the engine immediately after connecting, if authentication is successful, the Engine adds it to the list of trusted clients which it would send events to.

The authentication message is a connection string in the formart `"<ArgusAuth>Username:Password</ArgusAuth>"`, where the `Username` and `Password` are the placeholders for the ARGUS Engine auth credentials.
The authentication message is a connection string in the format `"<ArgusAuth>Username:Password</ArgusAuth>"`, where the `Username` and `Password` are the placeholders for the ARGUS Engine auth credentials.

```go
connectionString := fmt.Sprintf("<ArgusAuth>%s:%s</ArgusAuth>", "testusername", "testpassword")
Expand All @@ -73,33 +74,32 @@ The authentication message is a connection string in the formart `"<ArgusAuth>Us

### Listening for events and messages

In order to listen for events and messages you have to continously listen on the TCP stream for incoming data and then deserialize into an identifiable object ( for events), or log out messages for ordinary application messages.
In order to listen for events and messages you have to continously listen on the TCP stream for incoming data and then deserialize into an identifiable object (for events), or log out messages for ordinary application messages.

```go
buffer := make([]byte, 1024)
for {
// Read data from the client
n, err := conn.Read(buffer)
if err != nil {
argus.Errors <- err
}

data := string(buffer[:n])

if len(data) > 0 {

isJson, event, str := utils.IsJsonString(data)

if isJson {
// Push event to event channel
argus.Events <- event
} else {

argus.Messages <- fmt.Sprintf("Received: %s\n", str)
}
}

}
buffer := make([]byte, 1024)
for {
// Read data from the client
n, err := conn.Read(buffer)
if err != nil {
argus.Errors <- err
}

data := string(buffer[:n])

if len(data) > 0 {

isJson, event, str := utils.IsJsonString(data)

if isJson {
// Push event to event channel
argus.Events <- event
} else {
argus.Messages <- fmt.Sprintf("Received: %s\n", str)
}
}

}
```

```c#
Expand Down Expand Up @@ -132,11 +132,10 @@ Return the fetched event to the user.
Note: The Json string expected from the ARGUS Engine is as below:

```json
{
"Action" : "string",
"ActionDescription: "string",
"Name": "string",
"Timestamp": datetime
}
{
"Action" : "string",
"ActionDescription: "string",
"Name": "string",
"Timestamp": datetime
}
```

Loading