filesystem

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

README

Kubemq Filesystem Target Connector

Kubemq Filesystem target connector allows services using kubemq server to perform filesystem operation such as save,load, delete and list.

Prerequisites

The following are required to run the minio target connector:

  • kubemq cluster
  • kubemq-targets deployment

Configuration

Filesystem target connector configuration properties:

Properties Key Required Description Example
base_path yes base root for all functions "./"

Example:

bindings:
  - name: kubemq-query-filesystem
    source:
      kind: kubemq.query
      name: kubemq-query
      properties:
        address: "kubemq-cluster:50000"
        client_id: "kubemq-query-fs-connector"
        auth_token: ""
        channel: "query.fs"
        group:   ""
        auto_reconnect: "true"
        reconnect_interval_seconds: "1"
        max_reconnects: "0"
    target:
      kind: storage.filesystem
      name: target-filesystem
      properties:
        base_path: "./"

Usage

Save File Request

Save file request metadata setting:

Metadata Key Required Description Possible values
method yes method name "save"
path no set path for filename "path"
filename yes set filename "filename.txt"

Example:

{
  "metadata": {
    "method": "save",
    "path": "path",
    "filename": "filename.txt"
  },
  "data": "c29tZS1kYXRh"
}
Load File Request

Load file request metadata setting:

Metadata Key Required Description Possible values
method yes method name "load"
path no set path for filename "path"
filename yes set filename "filename.txt"

Example:

{
  "metadata": {
    "method": "load",
    "path": "path",
    "filename": "filename.txt"
  },
  "data": null
}
Delete File Request

Delete file request metadata setting:

Metadata Key Required Description Possible values
method yes method name "delete"
path no set path for filename "path"
filename yes set filename "filename.txt"

Example:

{
  "metadata": {
    "method": "delete",
    "path": "path",
    "filename": "filename.txt"
  },
  "data": null
}
List Request

List files in directory request metadata setting:

Metadata Key Required Description Possible values
method yes method name "list"
path no set path for filename "path"

Example:

{
  "metadata": {
    "method": "list",
    "path": "path"
  },
  "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(ctx context.Context, meta metadata) (*types.Response, error)

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) List

func (c *Client) List(ctx context.Context, meta metadata) (*types.Response, error)

func (*Client) Load

func (c *Client) Load(ctx context.Context, meta metadata) (*types.Response, error)

func (*Client) Save

func (c *Client) Save(ctx context.Context, meta metadata, data []byte) (*types.Response, error)

func (*Client) Stop

func (c *Client) Stop() error

type FileInfo

type FileInfo struct {
	Name     string `json:"name"`
	FullPath string `json:"full_path"`
	Size     int64  `json:"size"`
	IsDir    bool   `json:"is_dir"`
}

type FileInfoList

type FileInfoList []*FileInfo

func (FileInfoList) Marshal

func (l FileInfoList) Marshal() []byte

Jump to

Keyboard shortcuts

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