aerospike

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

README

Kubemq Aerospike Target Connector

Kubemq Aerospike target connector allows services using kubemq server to access Aerospike database services.

Prerequisites

The following are required to run the Aerospike target connector:

  • kubemq cluster
  • Aerospike server
  • kubemq-targets deployment

Configuration

Aerospike target connector configuration properties:

Properties Key Required Description Example
host yes Aerospike host address "localhost"
port yes Aerospike host port "3000"
username no Aerospike username "admin"
password no Aerospike password "password"
timeout no set timeout in seconds "30"

Example:

bindings:
- name: aerospike
  source:
    kind: kubemq.query
    properties:
      address: localhost:50000
      channel: query.aerospike
  target:
    kind: stores.aerospike
    properties:
      host: localhost
      port: "3000"
  properties: {}

Usage

Get Request

Get request metadata setting:

Metadata Key Required Description Possible values
key yes key string any string
user_key yes user key string any string
namespace yes namespace name any string
method yes get "get"

Example:

{
  "metadata": {
    "key": "your-Aerospike-key",
    "user_key": "your-user_key",
    "namespace": "test",
    "method": "get"
  },
  "data": null
}
Set Request

Set request metadata setting:

Metadata Key Required Description Possible values
key yes Aerospike key string any string
method yes set "set"

Set request data setting:

Data Key Required Description Possible values
data yes data to set for the Aerospike key base64 bytes array

Example:

{
  "metadata": {
    "method": "set"
  },
  "data": "eyJiaW5fbWFwIjp7ImJpbjEiOjQyLCJiaW4yIjoiQW4gZWxlcGhhbnQgaXMgYSBtb3VzZSB3aXRoIGFuIG9wZXJhdGluZyBzeXN0ZW0iLCJiaW4zIjpbIkdvIiwyMDA5XX0sImtleV9uYW1lIjoic29tZS1rZXkiLCJuYW1lc3BhY2UiOiJ0ZXN0IiwidXNlcl9rZXkiOiJ1c2VyX2tleTEifQ==" 
}
Delete Request

Delete request metadata setting:

Metadata Key Required Description Possible values
key yes key string any string
user_key yes user key string any string
namespace yes namespace name any string
method yes delete "delete"

Example:

{
  "metadata": {
    "key": "your-Aerospike-key",
    "user_key": "your-user_key",
    "namespace": "test",
    "method": "delete"
  },
  "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) Delete

func (c *Client) Delete(meta metadata) (*types.Response, error)

func (*Client) Do

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

func (*Client) Get

func (c *Client) Get(meta metadata) (*types.Response, error)

func (*Client) GetBatch

func (c *Client) GetBatch(meta metadata, data []byte) (*types.Response, error)

func (*Client) Init

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

func (*Client) Put

func (c *Client) Put(meta metadata, data []byte) (*types.Response, error)

func (*Client) Stop

func (c *Client) Stop() error

type GetBatchRequest

type GetBatchRequest struct {
	KeyNames  []*string `json:"key_names"`
	BinNames  []string  `json:"bin_names"`
	Namespace string    `json:"namespace"`
}

type PutRequest

type PutRequest struct {
	BinMap    map[string]interface{} `json:"bin_map"`
	KeyName   string                 `json:"key_name"`
	Namespace string                 `json:"namespace"`
	UserKey   interface{}            `json:"user_key"`
}

Jump to

Keyboard shortcuts

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