Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ rm-test-db:
.PHONY: run-migration
run-migration:
go run cmd/psqlqueue/main.go migrate

.PHONY: create-mocks
create-mocks:
@rm -rf mocks
mockery --all
8 changes: 8 additions & 0 deletions domain/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,11 @@ type MessageRepository interface {
Ack(ctx context.Context, id string) error
Nack(ctx context.Context, id string, visibilityTimeoutSeconds uint) error
}

// MessageService is the service interface for the Message entity.
type MessageService interface {
Create(ctx context.Context, message *Message) error
List(ctx context.Context, queueID, label *string, limit uint) ([]*Message, error)
Ack(ctx context.Context, id string) error
Nack(ctx context.Context, id string, visibilityTimeoutSeconds uint) error
}
12 changes: 12 additions & 0 deletions domain/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,15 @@ type QueueRepository interface {
Purge(ctx context.Context, id string) error
Cleanup(ctx context.Context, id string) error
}

// QueueService is the service interface for the Queue entity.
type QueueService interface {
Create(ctx context.Context, queue *Queue) error
Update(ctx context.Context, queue *Queue) error
Get(ctx context.Context, id string) (*Queue, error)
List(ctx context.Context, offset, limit int) ([]*Queue, error)
Delete(ctx context.Context, id string) error
Stats(ctx context.Context, id string) (*QueueStats, error)
Purge(ctx context.Context, id string) error
Cleanup(ctx context.Context, id string) error
}
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ require (
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.uber.org/atomic v1.7.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
Expand Down
143 changes: 143 additions & 0 deletions mocks/MessageRepository.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

113 changes: 113 additions & 0 deletions mocks/MessageService.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading