chore(readme): move readme from markdown to asciidoc format The final rendered output looks same as markdown (no particular reason for converting)
Brijesh ops@brijesh.dev
Thu, 04 Jul 2024 13:20:06 +0530
1 files changed,
53 insertions(+),
42 deletions(-)
jump to
M
README.md
→
README.adoc
@@ -1,6 +1,7 @@
-# Watchman + += Watchman -## Overview +== Overview Watchman is a hacky small scale logging tool for my personal projects kind of like that art you made in kindergarden (awesome, but not exactly museum worthy).@@ -8,80 +9,90 @@ i wrote this purely for my own amusement, since it doesn't even have basic auth, this project is strictly a "don't try this at home" situation.
Maybe someday I'll get around to adding auth, but even then, this is best used with toy projects. -### Project Management API +=== Project Management API -#### TOC +==== TOC -- [1. Create Project](#1-create-project) -- [2. List Projects](#2-list-projects) -- [3. Get Project By ID](#3-get-project-by-id) -- [4. Update Project](#4-update-project) -- [5. Delete Project](#5-delete-project) +* <<1-create-project,1. Create Project>> +* <<2-list-projects,2. List Projects>> +* <<3-get-project-by-id,3. Get Project By ID>> +* <<4-update-project,4. Update Project>> +* <<5-delete-project,5. Delete Project>> -#### 1. Create Project +==== 1. Create Project -```sh +[source,sh] +---- curl -X POST http://127.0.0.1:4000/projects -d '{"name": "Project 1"}' -``` +---- -#### 2. List Projects +==== 2. List Projects -```sh +[source,sh] +---- curl http://127.0.0.1:4000/projects -``` +---- -#### 3. Get Project By ID +==== 3. Get Project By ID -```sh +[source,sh] +---- curl -X GET http://127.0.0.1:4000/projects/{id} -``` +---- -#### 4. Update Project +==== 4. Update Project -```sh +[source,sh] +---- curl -X PUT http://127.0.0.1:4000/projects/{id} -d '{"name": "Updated Project Name"}' -``` +---- -#### 5. Delete Project +==== 5. Delete Project -```sh +[source,sh] +---- curl -X DELETE http://127.0.0.1:4000/projects/{id} -``` +---- -### Log Management API +=== Log Management API -#### TOC +==== TOC -- [1. Create Logs (Bulk)](#1-create-logs-bulk) -- [2. List Logs](#2-list-logs) -- [3. Delete Logs](#3-delete-logs) +* <<1-create-logs-bulk,1. Create Logs (Bulk)>> +* <<2-list-logs,2. List Logs>> +* <<3-delete-logs,3. Delete Logs>> -#### 1. Create Logs (Bulk) +==== 1. Create Logs (Bulk) -```sh +[source,sh] +---- curl -X POST http://127.0.0.1:4000/logs -d '[{"time": 1615760000, "level": "info", "message": "this is a test log", "subject": "test", "user_id": "1", "project_id": "1"}]' -``` +---- -#### 2. List Logs +==== 2. List Logs -```sh +[source,sh] +---- curl http://127.0.0.1:4000/logs?project_id=1 -``` +---- Or you add more query params to filter the logs -```sh +[source,sh] +---- curl http://127.0.0.1:4000/logs?project_id=1&user_id=1&log_level=info&start_time=1615760000&end_time=1615760000 -``` +---- -#### 3. Delete Logs +==== 3. Delete Logs -```sh +[source,sh] +---- curl -X DELETE http://127.0.0.1:4000/logs?project_id=1 -``` +---- Or you can add more query params to filter the logs -```sh +[source,sh] +---- curl -X DELETE http://127.0.0.1:4000/logs?project_id=1&user_id=2 -``` +----