nats

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

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

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

README


{ "image": "direktiv/nats", "desc": "Writes a message to a NATS Service" }

NATS

Writes a message to a NATS Service

Direktiv

An example workflow of writing to a NATS service.

id: nats
functions:
- id: nats-write
  image: direktiv/nats:v1
description: "Writes a message to a NATS service"
states:
- id: natswrite
  type: action
  action:
    function: nats-write
    input: jq(.)

Input

Writes a message to the NATS service hosted on the address. The fields username and password are optional fields used for user authentication.

input:
  address: "localhost:4222"
  username: "test"
  password: "test"
  subject: "direktiv"
  message: "Hello World :)!"

Output

If the output is successful nothing will be written but the message should appear in queue on NATS.

Error

In the case that an error is encountered, it will present in the following format:

{
    "errorCode": "com.nats.error",
    "errorMsg": "Something went wrong"
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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