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 |
||
---|---|---|
.idea | ||
cmd/go-lock | ||
internal | ||
pkg/redlock | ||
scripts | ||
.gitignore | ||
LICENSE | ||
Makefile | ||
README.md | ||
go.mod | ||
go.sum | ||
lock.proto |
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
- Clone the repo
git clone https://github.com/stoex/go-lock.git
- Install dependencies
make deps
- Generate Code
make gen
- Start up a redis instance
make redis
- 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-tls
the server uses certificates fromgoogle.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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - 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