Httpmq-go - Golang client for httpmq

HTTP MQ - Go Client

Golang client for httpmq

MIT Go Report Card CICD workflow FOSSA Status

Table of Content


1. Introduction

This Golang client is built upon the auto-generated client SDK of httpmq's OpenAPI specification. Tho auto-generated SDK is placed under the api package.

NOTE: Some modifications were made to the autogenerated SDK to correct the data types.

Though one can use the generated code in the api package directly, a more user friendly wrapper API is provided through the following packages:

  • common: support and utility code.
  • management: interact with httpmq's management API group.
  • dataplane: interact with httpmq's dataplane API group.

2. Installation

$ GO111MODULE=on go get github.com/alwitt/httpmq-go
import (
   hmqCommon "github.com/alwitt/httpmq-go/common"
   hmqData "github.com/alwitt/httpmq-go/dataplane"
   hmqCtrl "github.com/alwitt/httpmq-go/management"
)

3. Examples

4. Local Development

NOTE: Though the described procedures supports local development, the same docker-compose.yaml can be used to create a httpmq test environment independent of this project.

A helper Makefile is included to automate the common development tasks. The available make targets are:

$ make help
lint                           Lint the files
fix                            Lint and fix vialoations
compose                        Run docker-compose to create the DEV ENV
test                           Run unittests
build                          Build the test application
clean                          Clean up DEV ENV
help                           Display this help screen

First, start the development environment:

$ make compose
Removing httpmq-go_httpmq-mgmt_1 ... done
Removing httpmq-go_httpmq-data_1 ... done
Removing httpmq-go_dev-nats_1    ... done
Removing network httpmq-go_httpmq-go-test
Creating network "httpmq-go_httpmq-go-test" with driver "bridge"
Creating httpmq-go_httpmq-data_1 ... done
Creating httpmq-go_httpmq-mgmt_1 ... done
Creating httpmq-go_dev-nats_1    ... done

Verify the components are running:

3000/tcp httpmq-go_httpmq-mgmt_1 0c0a1692e202 alwitt/httpmq:0.2.0 "/usr/bin/httpmq.bin…" About a minute ago Up About a minute 127.0.0.1:4001->3000/tcp httpmq-go_httpmq-data_1">
$ docker ps
CONTAINER ID   IMAGE                 COMMAND                  CREATED              STATUS              PORTS                          NAMES
3b4ed2266732   nats:2.6.2            "/nats-server --conf…"   About a minute ago   Up About a minute   4222/tcp, 6222/tcp, 8222/tcp   httpmq-go_dev-nats_1
9406866489fb   alwitt/httpmq:0.2.0   "/usr/bin/httpmq.bin…"   About a minute ago   Up About a minute   127.0.0.1:4000->3000/tcp       httpmq-go_httpmq-mgmt_1
0c0a1692e202   alwitt/httpmq:0.2.0   "/usr/bin/httpmq.bin…"   About a minute ago   Up About a minute   127.0.0.1:4001->3000/tcp       httpmq-go_httpmq-data_1

Verify the code builds and passes unit-tests:

$ make
$ make test
?   	github.com/alwitt/httpmq-go	[no test files]
?   	github.com/alwitt/httpmq-go/api	[no test files]
?   	github.com/alwitt/httpmq-go/cmd	[no test files]
?   	github.com/alwitt/httpmq-go/common	[no test files]
ok  	github.com/alwitt/httpmq-go/dataplane	0.065s
ok  	github.com/alwitt/httpmq-go/management	0.097s

The demo application built is httpmq-test-cli.bin. It exercises all the functionalities of the APIs. These functionalities are separated into subcommands, and the associated usage message explains how to call each functionality.

$ ./httpmq-test-cli.bin -h
NAME:
   httpmq-test-cli.bin - HTTP MQ demo application

USAGE:
   httpmq-test-cli.bin [global options] command [command options] [arguments...]

VERSION:
   v0.1.0

DESCRIPTION:
   Demo application for trying out functionalities of httpmq

COMMANDS:
   management, mgmt  management API client
   dataplane, data   dataplane API client
   help, h           Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help (default: false)
   --version, -v  print the version (default: false)
$ ./httpmq-test-cli.bin management -h
NAME:
   httpmq-test-cli.bin management - management API client

USAGE:
   httpmq-test-cli.bin management command [command options] [arguments...]

DESCRIPTION:
   Operate the httpmq management API

COMMANDS:
   stream    Manage streams
   consumer  Manage consumers
   help, h   Shows a list of commands or help for one command

OPTIONS:
   --json-log, -j                           Whether to log in JSON format (default: false) [$LOG_AS_JSON]
   --log-level value, -l value              Logging level: [debug info warn error] (default: info) [$LOG_LEVEL]
   --custom-ca-file value, --ccf value      Custom CA file to use with HTTP client [$HTTP_CUSTOM_CA_FILE]
   --management-server-url value, -s value  Management server URL (default: http://127.0.0.1:4000) [$MANAGEMENT_SERVER_URL]
   --help, -h                               show help (default: false)
$ ./httpmq-test-cli.bin management stream -h
NAME:
   httpmq-test-cli.bin management stream - Manage streams

USAGE:
   httpmq-test-cli.bin management stream command [command options] [arguments...]

DESCRIPTION:
   Manages streams through httpmq management API

COMMANDS:
   list                  List all streams
   create                Define a new stream
   get                   Fetch one stream
   delete                Delete one stream
   change-subject, cs    Change target subject of stream
   change-retention, ca  Change stream message retention
   help, h               Shows a list of commands or help for one command

OPTIONS:
   --help, -h  show help (default: false)
$ ./httpmq-test-cli.bin management consumer -h
NAME:
   httpmq-test-cli.bin management consumer - Manage consumers

USAGE:
   httpmq-test-cli.bin management consumer command [command options] [arguments...]

DESCRIPTION:
   Manages consumers through httpmq management API

COMMANDS:
   list     List all consumers
   get      Fetch one consumer
   create   Define a new consumer
   delete   Delete a consumer
   help, h  Shows a list of commands or help for one command

OPTIONS:
   --stream value, -s value  Target stream to operate against [$TARGET_STREAM]
   --help, -h                show help (default: false)
$ ./httpmq-test-cli.bin dataplane -h
NAME:
   httpmq-test-cli.bin dataplane - dataplane API client

USAGE:
   httpmq-test-cli.bin dataplane command [command options] [arguments...]

DESCRIPTION:
   Operate the httpmq dataplane API

COMMANDS:
   publish, pub    Publish messages
   subscribe, sub  Subscribe for messages
   help, h         Shows a list of commands or help for one command

OPTIONS:
   --json-log, -j                          Whether to log in JSON format (default: false) [$LOG_AS_JSON]
   --log-level value, -l value             Logging level: [debug info warn error] (default: info) [$LOG_LEVEL]
   --custom-ca-file value, --ccf value     Custom CA file to use with HTTP client [$HTTP_CUSTOM_CA_FILE]
   --dataplane-server-url value, -s value  Dataplane server URL (default: http://127.0.0.1:4001) [$DATAPLANE_SERVER_URL]
   --help, -h                              show help (default: false)

5. License

Unless otherwise noted, the httpmq-go source files are distributed under the MIT license found in the LICENSE file.

FOSSA Status

Similar Resources

An AMQP 0-9-1 Go client maintained by the RabbitMQ team. Originally by @streadway: `streadway/amqp`

Go RabbitMQ Client Library This is a Go AMQP 0.9.1 client maintained by the RabbitMQ core team. It was originally developed by Sean Treadway. Differen

Jan 1, 2023

franz-go - A complete Apache Kafka client written in Go

franz-go contains a feature complete, pure Go library for interacting with Kafka from 0.8.0 through 2.8.0+. Producing, consuming, transacting, administrating, etc.

Dec 29, 2022

Go client libraries for Kafka

kafka-go Motivations We rely on both Go and Kafka a lot at Segment. Unfortunately, the state of the Go client libraries for Kafka at the time of this

Jan 10, 2022

Experiments using Go 1.18beta1's Generic typings and the Segmentio kafka-go consumer client

Experiments using Go 1.18beta1's Generic typings and the Segmentio kafka-go consumer client

Jan 28, 2022

graylog-golang is a full implementation for sending messages in GELF (Graylog Extended Log Format) from Go (Golang) to Graylog

graylog-golang is a full implementation for sending messages in GELF (Graylog Extended Log Format) from Go (Golang) to Graylog

Dec 5, 2022

socket.io library for golang, a realtime application framework.

go-socket.io go-socket.io is library an implementation of Socket.IO in Golang, which is a realtime application framework. Current this library support

Jan 8, 2023

golang long polling library. Makes web pub-sub easy via HTTP long-poll server :smiley: :coffee: :computer:

golang long polling library.  Makes web pub-sub easy via HTTP long-poll server :smiley: :coffee: :computer:

golongpoll Golang long polling library. Makes web pub-sub easy via an HTTP long-poll server. New in v1.1 Deprecated CreateManager and CreateCustomMana

Jan 6, 2023

Golang push server cluster

Golang push server cluster

gopush-cluster gopush-cluster is a go push server cluster. Features light weight high performance pure golang implementation message expired offline m

Dec 28, 2022

A push notification server written in Go (Golang).

A push notification server written in Go (Golang).

gorush A push notification micro server using Gin framework written in Go (Golang) and see the demo app. Contents gorush Contents Support Platform Fea

Jan 8, 2023
Comments
  • Add license scan report and status

    Add license scan report and status

    Your FOSSA integration was successful! Attached in this PR is a badge and license report to track scan status in your README.

    Below are docs for integrating FOSSA license checks into your CI:

Related tags
golang client library to Viessmann Vitotrol web service

Package go-vitotrol provides access to the Viessmann™ Vitotrol™ cloud API for controlling/monitoring boilers. See https://www.viessmann.com/app_vitoda

Nov 16, 2022
Golang client for NATS, the cloud native messaging system.

NATS - Go Client A Go client for the NATS messaging system. Installation # Go client go get github.com/nats-io/nats.go/ # Server go get github.com/na

Jan 5, 2023
High abstraction wrapper for Golang Rabbit MQ Client

GRMQ Go Rabbit MQ What are the typical use-cases of RabbitMQ broker ? We create

Nov 3, 2022
It's client library written in Golang for interacting with Linkedin Cruise Control using its HTTP API.

go-cruise-control It's client library (written in Golang) for interacting with Linkedin Cruise Control using its HTTP API. Supported Cruise Control ve

Jan 10, 2022
Go client to reliable queues based on Redis Cluster Streams

Ami Go client to reliable queues based on Redis Cluster Streams. Consume/produce performance Performance is dependent from: Redis Cluster nodes count;

Dec 12, 2022
RabbitMQ Reconnection client

rmqconn RabbitMQ Reconnection for Golang Wrapper over amqp.Connection and amqp.Dial. Allowing to do a reconnection when the connection is broken befor

Sep 27, 2022
An easy-to-use CLI client for RabbitMQ.

buneary, pronounced bun-ear-y, is an easy-to-use RabbitMQ command line client for managing exchanges, managing queues and publishing messages to exchanges.

Sep 3, 2022
Go client library SDK for Ably realtime messaging service

Ably Go A Go client library for www.ably.io, the realtime messaging service. Installation ~ $ go get -u github.com/ably/ably-go/ably Feature support T

Dec 2, 2022
Cluster extensions for Sarama, the Go client library for Apache Kafka 0.9

Cluster extensions for Sarama, the Go client library for Apache Kafka 0.9 (and later).

Dec 28, 2022
Apache Pulsar Go Client Library

Apache Pulsar Go Client Library A Go client library for the Apache Pulsar project. Goal This projects is developing a pure-Go client library for Pulsa

Jan 4, 2023