pubsub

command module
v0.0.0-...-cf5454a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2024 License: MIT Imports: 1 Imported by: 0

README

PubSub CLI

A command-line tool to emulate a Pub/Sub service. This tool allows you to manage topics, subscriptions, and messages, mimicking the behavior of a Pub/Sub system in a local SQLite database.

Features

  • Initialize the Pub/Sub environment with necessary tables and database setup.
  • Add topics, subscriptions, and messages.
  • List topics, subscriptions, and messages.
  • Acknowledge (Ack) messages to mark them as processed.
  • Pull unacknowledged messages for consumption.
  • Clean the database to remove all topics, subscriptions, and messages.

Installation

  1. Clone the repository:

    git clone github.com/nigel-campbell/pubsub.git
    cd pubsub
    
  2. Build the CLI:

    make build
    
  3. Run the CLI:

    ./bin/pubsub
    

Usage

The basic commands are:

./bin/pubsub init                                  # Initialize database and tables
./bin/pubsub add topic <TOPIC_NAME> -d <CONFIG>    # Add a topic
./bin/pubsub add subscription <TOPIC_ID> <SUBSCRIPTION_ID> -d <CONFIG>   # Add a subscription
./bin/pubsub add message <TOPIC_ID> -d <MESSAGE_PAYLOAD>                # Add a message
./bin/pubsub list topics                           # List all topics
./bin/pubsub list subscriptions <TOPIC_ID>         # List subscriptions for a topic
./bin/pubsub pull <SUBSCRIPTION_ID>                # Pull messages for a subscription
./bin/pubsub ack <SUBSCRIPTION_ID> <MESSAGE_ID>    # Acknowledge a message
./bin/pubsub clean                                 # Clean all data

License

This project is licensed under the terms of the MIT License.

Documentation

Overview

Copyright © 2024 Nigel Campbell <n.a.campbell7@gmail.com>

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL