Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gRPC PubSub Service

A gRPC-based publish-subscribe service implementation using the subpub package.

Features

  • gRPC API for subscribing to and publishing events
  • Graceful shutdown
  • Dependency injection
  • Logging
  • Thread-safe message handling

Run directly

go run cmd/server/main.go #run server

Run with docker-compose

docker-compose -f deployments/docker-compose.yml up --build

Api Documentation

go run cmd/client/main.go -mode sub -key test-key # run client in subscriber mode
go run cmd/client/main.go -mode pub -key test-key -message "Hello World!" # run client in publisher mode
go run cmd/client/main.go -mode both -key test-key -message "Hello World!" # run in client subscriber and publisher mode

Flags

  • -addr: Server address (default: localhost:50051)
  • -mode: Client mode: sub, pub, or both (default: both)
  • -key: Subscription/publish key (default: test-key)
  • -message: Message to publish (default: Hello!)

Configuration

{
    "server": {
        "host": "0.0.0.0",
        "port": "50051"
    },
    "log": {
        "level": "info",
        "file": "pubsub.log"
    }
}

Tests

go test -cover
PASS
coverage: 97.8% of statements
ok      github.com/ItserX/subpub/internal/subpub        0.305s

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages