update package

This commit is contained in:
2025-11-25 19:05:10 +01:00
parent 7ce4216383
commit 8d2f5db47d
2 changed files with 42 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
# 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
```bash
go get git.k6n.net/go-redis-inventory
```
## Usage
Import the package:
```go
import "git.k6n.net/go-redis-inventory/pkg/inventory"
```
Create a Redis client and initialize the service:
```go
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](https://github.com/redis/go-redis)

2
go.mod
View File

@@ -1,4 +1,4 @@
module git.tornberg.me/mats/go-redis-inventory
module git.k6n.net/go-redis-inventory
go 1.25.1