openfaas

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: 9 Imported by: 0

README

Kubemq OpenFaas Target Connector

Kubemq OpenFaas target connector allows services using kubemq server to invoke OpensFaas's functions.

Prerequisites

The following are required to run the OpenFaas target connector:

  • kubemq cluster
  • OpenFaas platform
  • kubemq-targets deployment

Configuration

OpenFaas target connector configuration properties:

Properties Key Required Description Example
gateway yes OpenFaas gateway address "http://localhost:31112"
username yes Openfaas gateway username "admin"
password yes OpenFaas gateway password "password"

Example:

bindings:
  - name: kubemq-query-OpenFaas
    source:
      kind: kubemq.query
      name: kubemq-query
      properties:
        address: "kubemq-cluster:50000"
        client_id: "kubemq-query-OpenFaas-connector"
        auth_token: ""
        channel: "query.OpenFaas"
        group:   ""
        auto_reconnect: "true"
        reconnect_interval_seconds: "1"
        max_reconnects: "0"
    target:
      kind: serverless.openfaas
      name: target-serverless-openfaas
      properties:
        gateway: "http://localhost:31112"
        username: "admin"
        password: "password"

Usage

Request

Request metadata setting:

Metadata Key Required Description Possible values
topic yes OpenFaas function topic "function/nslookup"

Request data setting:

Data Key Required Description Possible values
data yes data to set for the OpenFaas request base64 bytes array

Example:

{
  "metadata": {
    "topic": "function/nslookup"
  },
 "data": "a3ViZW1xLmlv"
}

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, req *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