Skip to content

Commit ac6162e

Browse files
committed
feat: added CI workflow and update module path
1 parent 418b823 commit ac6162e

5 files changed

Lines changed: 73 additions & 11 deletions

File tree

.github/workflows/sqliteq.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: SQLiteQ CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths-ignore:
7+
- "**.md"
8+
- "docs/**"
9+
- "LICENSE"
10+
pull_request:
11+
branches: [main]
12+
paths-ignore:
13+
- "**.md"
14+
- "docs/**"
15+
- "LICENSE"
16+
17+
jobs:
18+
test:
19+
runs-on: ubuntu-latest
20+
21+
services:
22+
redis:
23+
image: redis:latest
24+
ports:
25+
- 6375:6379
26+
options: >-
27+
--health-cmd "redis-cli ping"
28+
--health-interval 10s
29+
--health-timeout 5s
30+
--health-retries 5
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Set up Go
36+
uses: actions/setup-go@v5
37+
with:
38+
go-version: "1.24.1"
39+
cache: true
40+
41+
- name: Install dependencies
42+
run: go mod download
43+
44+
- name: Run tests with coverage
45+
run: |
46+
go test -race -coverprofile=coverage.txt -covermode=atomic ./...
47+
env:
48+
REDIS_URL: redis://localhost:6375
49+
50+
- name: Upload coverage reports to Codecov
51+
uses: codecov/codecov-action@v5
52+
53+
with:
54+
token: ${{ secrets.CODECOV_TOKEN }}
55+
slug: goptics/redisq
56+
files: ./coverage.txt
57+
verbose: true

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
# SQLiteQ: A Thread-Safe SQLite-Based Queue for Go
1+
# SQLiteQ: A SQLite-Based Persistent Queue for Go
22

3-
SQLiteQ is a thread-safe, persistent queue implementation in Go using SQLite as the storage backend. It provides efficient enqueue and dequeue operations and maintains persistence across application restarts.
3+
[![Go Reference](https://img.shields.io/badge/go-pkg-00ADD8.svg?logo=go)](https://pkg.go.dev/github.com/goptics/sqliteq)
4+
[![Go Report Card](https://goreportcard.com/badge/github.com/goptics/sqliteq)](https://goreportcard.com/report/github.com/goptics/sqliteq)
5+
[![Go Version](https://img.shields.io/badge/Go-1.24+-00ADD8?style=flat-square&logo=go)](https://golang.org/doc/devel/release.html)
6+
[![CI](https://github.com/goptics/sqliteq/actions/workflows/sqliteq.yml/badge.svg)](https://github.com/goptics/sqliteq/actions/workflows/go.yml)
7+
[![codecov](https://codecov.io/gh/goptics/sqliteq/branch/main/graph/badge.svg)](https://codecov.io/gh/goptics/sqliteq)
8+
9+
SQLiteQ is a persistent queue implementation in Go using SQLite as the storage backend. It provides efficient enqueue and dequeue operations and maintains persistence across application restarts.
410

511
## Features
612

7-
- Thread-safe queue operations using mutexes and SQLite transactions
813
- Efficient enqueue and dequeue operations
914
- Persistence via SQLite storage
1015
- Support for acknowledgment-based processing

example/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"os"
77
"time"
88

9-
"github.com/fahimfaisaal/sqliteq"
9+
"github.com/goptics/sqliteq"
1010
)
1111

1212
// regularQueueExample demonstrates the basic queue functionality

example/priority_queue_example.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"os"
66
"time"
77

8-
"github.com/fahimfaisaal/sqliteq"
8+
"github.com/goptics/sqliteq"
99
)
1010

1111
func priorityQueueExample() {
@@ -30,19 +30,19 @@ func priorityQueueExample() {
3030
}
3131

3232
fmt.Println("Adding items to priority queue with different priorities:")
33-
33+
3434
// Add high priority tasks (0 - highest priority)
3535
priorityQueue.Enqueue(Task{1, "High priority task 1"}, 0)
3636
fmt.Println("- Added: High priority task 1 (priority 0 - highest)")
37-
37+
3838
// Add medium priority tasks (5)
3939
priorityQueue.Enqueue(Task{2, "Medium priority task 1"}, 5)
4040
fmt.Println("- Added: Medium priority task 1 (priority 5)")
41-
41+
4242
// Add more high priority tasks
4343
priorityQueue.Enqueue(Task{3, "High priority task 2"}, 0)
4444
fmt.Println("- Added: High priority task 2 (priority 0 - highest)")
45-
45+
4646
// Add low priority tasks (10 - lowest priority)
4747
priorityQueue.Enqueue(Task{4, "Low priority task 1"}, 10)
4848
fmt.Println("- Added: Low priority task 1 (priority 10 - lowest)")
@@ -58,7 +58,7 @@ func priorityQueueExample() {
5858
fmt.Println("- Queue is empty")
5959
break
6060
}
61-
61+
6262
// When items are serialized/deserialized through JSON, they come back as map[string]interface{}
6363
if taskMap, ok := item.(map[string]interface{}); ok {
6464
// Extract ID and description from the map

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/fahimfaisaal/sqliteq
1+
module github.com/goptics/sqliteq
22

33
go 1.20
44

0 commit comments

Comments
 (0)