gRPC server providing DLM functionality using the redlock algorithm. (https://redis.io/topics/distlock)
 
 
 
Go to file
Christian Nicola 63a78645b8 Feature: Add logging to application
Logging is configured based on build constraints

* Contextual logging: if there is a correlation id in context argument then it will be added to the log statements
* Debug builds log plain text to console
* Release builds log JSON formatted messages
* Added log statements to lock_service.go
2020-05-31 20:22:19 +02:00
.idea Implement config pkg 2020-05-03 15:33:02 +02:00
cmd/go-lock Feature: Add logging to application 2020-05-31 20:22:19 +02:00
internal Feature: Add logging to application 2020-05-31 20:22:19 +02:00
pkg/redlock Feature: Add logging to application 2020-05-31 20:22:19 +02:00
scripts Change time duration for locks from milliseconds to seconds 2020-05-16 14:27:51 +02:00
.gitignore Fix grpc code generation 2020-05-04 09:06:41 +02:00
LICENSE Initial commit 2020-05-03 15:21:21 +02:00
Makefile Feature: Add logging to application 2020-05-31 20:22:19 +02:00
README.md Add README 2020-05-16 14:59:20 +02:00
go.mod Feature: Add logging to application 2020-05-31 20:22:19 +02:00
go.sum Feature: Add logging to application 2020-05-31 20:22:19 +02:00
lock.proto Change time duration for locks from milliseconds to seconds 2020-05-16 14:27:51 +02:00

README.md


go-lock

gRPC server providing DLM functionality using the redlock algorithm. (https://redis.io/topics/distlock)

Report Bug · Request Feature

Table of Contents

Built With

  • Golang
  • gRPC
  • Redis

Getting Started

To get a local copy up and running follow these simple steps.

Prerequisites

This project provides a Makefile for testing / generating / building the project.

Installation

  1. Clone the repo
git clone https://github.com/stoex/go-lock.git
  1. Install dependencies
make deps
  1. Generate Code
make gen
  1. Start up a redis instance
make redis
  1. Build the project
make all

Please see make help for a list of available commands.

Configuration

The program uses environment variables and CLI flags for configuration. To specify which redis clients should be used to connect please specify the following variable:

REDIS_CLIENTS=redis://...,redis://...,redis://...

The variable should be used as a comma separated list - you can specify however many clients you wish to connect to. During development you can also use a .env file like so:

echo 'REDIS_CLIENTS=...' > .env

The .env file should be placed in the same directory the server is run from.

Usage

See the servers available parameters with go-lock -h.

Note: if -cert_file or -key_file are not used in conjuction with -tlsthe server uses certificates from google.golang.org/grpc/testdata instead.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Chris Nicola - @chrisnicola_ - hi@chrisnicola.de

Project Link: https://github.com/stoex/go-lock