Go Redis Inventory
A Go library for managing inventory using Redis.
Features
- Get and update inventory quantities
- Reserve inventory with atomic operations using Lua scripts
- Listen to inventory changes via Redis pub/sub
Installation
go get git.k6n.net/go-redis-inventory
Usage
Import the package:
import "git.k6n.net/go-redis-inventory/pkg/inventory"
Create a Redis client and initialize the service:
client := redis.NewClient(&redis.Options{
Addr: "localhost:6379",
})
service, err := inventory.NewRedisInventoryService(client)
if err != nil {
log.Fatal(err)
}
Dependencies
- Go 1.25.1 or later
- Redis server
- github.com/redis/go-redis/v9
Description
Languages
Go
100%