Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

feat: adding response protocol #96

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions doc/TQL/TQL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Time trace is using a query language called TQL. Here is documentation and speci

| Command | Action | Arguments |
|----------|:-------------|:------|
| CON | to make a connection and access to database | username - password |
| CON * | to make a connection and access to database | username - password |
| SET * | make a new set | set-name |
| SSET * | make a new subset | set-name - subset-name |
| PUSH * | push an element to a subset | set-name - subset-name - value-of-element - time(unix-timestamp) |
Expand All @@ -34,4 +34,4 @@ Time trace is using a query language called TQL. Here is documentation and speci
| SNF | set is not found |
| SSNF | subset is not found |
| ENF | element(s) is not found |
| [DATA separated by space] (key-time key-time key-time) | GET successful response |
| DATA in format of [protocol](../protocol/) |
1 change: 1 addition & 0 deletions doc/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ In this documentation we have different parts:
* [model](./model/) (which is talk about data structure of time-trace and also some use case examples).
* [config](./config/) (which is show you how config works in time-trace).
* [TQL](./TQL/) (time query language).
* [protocol](./protocol/) (specification of time-trace protocol, which time-trace talks with).
* [usage](./usage/) (which is show how can you use time-trace in action).
21 changes: 21 additions & 0 deletions doc/protocol/protocol_v1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Protocol V1

This document will define the time trace protocol, which you need to know about (beside the [TQL](../TQL/)) to be able to make an client or driver for time trace.

# Requests

All of the data requesting from a time-trace database, will follow the [TQL](../TQL/) specification.

# Receiving Data

The TQL `GET` request data format:

```
<EOS-3bytes><value><S-1bytes><time><SOS-3bytes><protocolVersion-1bytes><payloadSize-8bytes>
```

EOS: end of sequence
SOS: start of sequence
S: separator (between each time and value)

> NOTE: value and time part can be repeated more than once depend on your request.