Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenghaoz committed Dec 31, 2024
1 parent a028cbb commit d5be5d3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 5 deletions.
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# gorse-go
Go SDK for gorse recommender system

# ToDO
- TestStrategy needs to be implemented -> Deployment Docker Compose from GORSE.IO
Go SDK for Gorse recommender system.

> ⚠️⚠️⚠️ This SDK is unstable currently. APIs might be changed in later versions.
## Install

```bash
go get github.com/gorse-io/gorse-go
```

## Usage

```go
import client "github.com/gorse-io/gorse-go"

gorse := client.NewGorseClient("http://127.0.0.1:8087", "api_key")

gorse.InsertFeedback([]client.Feedback{
{FeedbackType: "star", UserId: "bob", ItemId: "vuejs:vue", Timestamp: "2022-02-24"},
{FeedbackType: "star", UserId: "bob", ItemId: "d3:d3", Timestamp: "2022-02-25"},
{FeedbackType: "star", UserId: "bob", ItemId: "dogfalo:materialize", Timestamp: "2022-02-26"},
{FeedbackType: "star", UserId: "bob", ItemId: "mozilla:pdf.js", Timestamp: "2022-02-27"},
{FeedbackType: "star", UserId: "bob", ItemId: "moment:moment", Timestamp: "2022-02-28"},
})

gorse.GetRecommend("bob", "", 10)
```

## Test


In the root directory of Gorse source:

```bash
# Setup Gorse
docker compose up -d

# Test
go test .
```
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3"
services:
redis:
image: redis
image: redis/redis-stack:6.2.6-v9
restart: unless-stopped
ports:
- 6379:6379
Expand All @@ -18,7 +18,7 @@ services:
MYSQL_PASSWORD: gorse_pass

gorse:
image: zhenghaoz/gorse-in-one
image: zhenghaoz/gorse-in-one:0.5
restart: unless-stopped
ports:
- 8086:8086
Expand Down

0 comments on commit d5be5d3

Please sign in to comment.