Skip to content

Proglog, a distributed logging service that provides the ability to store and read log records.

Notifications You must be signed in to change notification settings

gdguesser/proglog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Proglog - Distributed Logging Service

This is a distributed logging service that provides the ability to store and read log records. The service is composed of an HTTP server that exposes the API endpoints for appending and reading log records, and a log store that persists the log records to disk.

Getting started

The following instructions will guide you on how to build, run, and test the service.

Prerequisites

  • Go 1.17 or higher
  • Protocol buffers compiler (protoc) 3.0 or higher

Building the service

To build the service, run the following command:

make build

This will compile the HTTP server binary into the bin/proglog directory.

Running the service

To run the service, run the following command:

make run

This will start the HTTP server on port 8080.

API documentation

The following API endpoints are available:

  • POST /v1/records: Appends a new log record.

Request:

{ "value": "The byte array of the log record to be appended." }

Response:

{ "offset": "The offset of the newly appended record." }
  • GET /v1/records/{offset}: Reads a log record at the specified offset.

Request URL parameters:

  • offset: The offset of the log record to be read.

Response:

{ "value": "The byte array of the log record." }

Testing the service

To run the tests, run the following command:

make test

This will run the unit tests for the log store.

Code organization

The code for the service is organized as follows:

  • api/v1/log.proto: The protocol buffer definition for the API endpoints.
  • bin/proglog/proglog: The HTTP server binary.
  • cmd/server/main.go: The main function that starts the HTTP server.
  • internal/log/store.go: The log store implementation.
  • internal/log/store_test.go: The unit tests for the log store.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Proglog, a distributed logging service that provides the ability to store and read log records.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published