echo

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

README

Kubemq Echo Target Connector

Kubemq Echo target connector allows to echo back any request for testing purposes.

Prerequisites

The following are required to run the echo target connector:

  • kubemq cluster
  • kubemq-targets deployment

Configuration

echo target does not need any configuration

Example:

bindings:
  - name: kubemq-query-https
    source:
      kind: kubemq.query
      name: kubemq-query
      properties:
        address: "kubemq-cluster:50000"
        client_id: "kubemq-query-http-connector"
        auth_token: ""
        channel: "query.http"
        group:   ""
        auto_reconnect: "true"
        reconnect_interval_seconds: "1"
        max_reconnects: "0"
    target:
      kind: echo
      name: echo
      properties: {}
        default_headers: '{"Content-Type":"application/json"}'

Usage

Any request will be send back as a response with the host name data embed within the metadata

Example:

{
  "metadata": {
    "method": "get",
    "url": "https://httpbin.org/get" 
  },
 "data": null
}

Will response back with:

{
  "metadata": {
    "host": "some-host",
    "method": "get",
    "url": "https://httpbin.org/get" 
  },
 "data": null
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connector

func Connector() *common.Connector

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New() *Client

func (*Client) Connector

func (c *Client) Connector() *common.Connector

func (*Client) Do

func (c *Client) Do(ctx context.Context, request *types.Request) (*types.Response, error)

func (*Client) Init

func (c *Client) Init(ctx context.Context, cfg config.Spec, log *logger.Logger) error

func (*Client) Stop

func (c *Client) Stop() error

Jump to

Keyboard shortcuts

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