Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vbyazilim/kvstore
Training material, in-memory key/value store example
https://github.com/vbyazilim/kvstore
golang key-value-store training-materials
Last synced: 20 days ago
JSON representation
Training material, in-memory key/value store example
- Host: GitHub
- URL: https://github.com/vbyazilim/kvstore
- Owner: vbyazilim
- License: other
- Created: 2023-08-20T16:38:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-23T11:02:26.000Z (about 1 year ago)
- Last Synced: 2024-06-21T08:10:58.891Z (7 months ago)
- Topics: golang, key-value-store, training-materials
- Language: Go
- Homepage: https://github.com/vbyazilim/maoyyk2023-golang-101-kursu
- Size: 33.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
![Version](https://img.shields.io/badge/version-0.1.4-orange.svg)
[![Golang Tests](https://github.com/vbyazilim/kvstore/actions/workflows/go-test.yml/badge.svg)](https://github.com/vbyazilim/kvstore/actions/workflows/go-test.yml)
[![Golang CI Lint](https://github.com/vbyazilim/kvstore/actions/workflows/go-lint.yml/badge.svg)](https://github.com/vbyazilim/kvstore/actions/workflows/go-lint.yml)
[![codecov](https://codecov.io/gh/vbyazilim/kvstore/graph/badge.svg?token=514LHYMOA4)](https://codecov.io/gh/vbyazilim/kvstore)
![Powered by Rake](https://img.shields.io/badge/powered_by-rake-blue?logo=ruby)# KVStore
Simple in-memory key/value store for training purpose. Project demonstrates
basic DDD approach (storage/service/http layer logic)---
## Usage
To run server locally;
```bash
rake
```or `cd` to project root;
```bash
go run cmd/server/main.go
```Endpoints:
```http
GET /healthz/live/
GET /healthz/ready/POST /api/v1/set/
GET /api/v1/get/?key={key}
PUT /api/v1/update/
DELETE /api/v1/delete/?key={key}
GET /api/v1/list/
```Also, you can use [postman](postman/KVStore.postman_collection.json) collection.
---
## Development
### Requirements
- `go1.21.0`
- `bumpversion`
- `pre-commit`You can create `.env` file inside of the project root for environment variables
Environment variables information:
| Variable Name | Description | Default Value |
|:--------------|:------------|:------------|
| `SERVER_ENV` | Server environment information for run-time | `local` |
| `LOG_LEVEL` | Logging level | `INFO` |### Install `pre-commit`
https://pre-commit.com/
```bash
$ cd /path/to/kvstore
$ pre-commit install # do only once!
```Available tasks:
```bash
$ rake -Trake default # default task
rake docker:build # Build image (locally)
rake docker:run # Run image (locally)
rake lint # run golangci lint
rake release[revision] # release new version major,minor,patch, default: patch
rake run:server # run server
rake test:run_all # run all tests
rake test:run_all_display_coverage # run all tests and display coverage
```Run all tests via;
```bash
rake test:run_all
rake test:run_all_display_coverage # macos only!
```---
## Docker
```bash
# build
rake docker:build# run
rake docker:run
```---