raithe

command module
v0.0.0-...-7354bfe Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2018 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Raithe Maintainability Go Report Card GoDoc

The Compact and Persistent Messaging Queue

Getting Started

Run Go Get
go get github.com/catmullet/Raithe
Modifying your env file

Your env file simply contains the port you want to run from and the redis configuration.

# Essential Configurations
PORT=8021

# Redis
REDIS_URL=127.0.0.1:6379
REDIS_PASSWORD=""
REDIS_DB=0
Fire It Up
go run raithe.go

Raithe

Your Agents List

Your agents list will contain all agents that can register as a "producer" or "consumer", both are the same to Raithe. Contained within your agents_list.json of the root folder you will see something like this. Just list the names of the agents and each agent will need to call the register path (/auth/register) to stake thier claim on that agent name.

{
  "agents": [
    "test"
  ]
}

Playing Around

Register Clients

A Client is any service attempting to push or pop from the message queue.
Contained within the root directory is a file agents_list.json. This file contains all the agents that can register and is read in realtime. So Adding an agent is easy.

Request /auth/register
{
	"agent_name":"{{agent name}}"
}
Response
{
    "success": true,
    "message": "",
    "security_token": {
        "agent_name": "{{agent name}}",
        "token": "{{token}}"
    }
}
Push Message

Pusing a message can be done by any agent. Queues are the key and will be how agents identify which queue to pull from.

Request /queue/push
{
	"queue":"test",
	"message":"Hello World",
	"security_token": {
        	"agent_name": "{{agent name}}",
        	"token": "{{token}}"
    }
}
Response
{
    "success": true
}
Pop Message

Popping a message from the queue will grab the oldest message first. Simple as that.

Request /queue/pop
{
	"queue":"test",
	"security_token": {
        	"agent_name": "{{agent name}}",
        	"token": "{{token}}"
    }
}
Response
{
    "queue": "test",
    "message": "Hello World"
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
app

Jump to

Keyboard shortcuts

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