tomlreader

package module
v0.0.0-...-dceaa68 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: MIT Imports: 5 Imported by: 0

README

Read and Query TOML

This activity provides your Flogo app the ability to read and query TOML files

Installation

flogo install github.com/retgits/flogo-components/activity/tomlreader

Link for flogo web:

https://github.com/retgits/flogo-components/activity/tomlreader

Schema

Inputs and Outputs:

{
    "inputs": [
        {
            "name": "filename",
            "type": "string",
            "required": true
        },
        {
            "name": "key",
            "type": "string",
            "required": true
        },
        {
            "name": "filters",
            "type": "string"
        }
    ],
    "outputs": [
        {
            "name": "result",
            "type": "array"
        }
    ]
}

Inputs

Input Description
filename The name of the file you want to write to (like data.txt or ./tmp/data.txt)
key The key you want to search for in the TOML file
filters A filter string (see below)

Ouputs

Output Description
result The array representing the result of searching the key

filters

The current implementation of this activity supports two filtering mechanisms:

  • Filter by value: Return the configuration item if one of the values in that item contains the value you're searching for
  • Filter by key: Return the configuration item if one of the keys of that item equals the value you're searching for
Filter by value

The filter ValueContains(retgits) would return all items where part any value in the item matches retgits

Filter by key

The filter KeyEquals(type,app) would return all items which have a key called type and where the value of that key equals app

Combining filters

Filters are applied sequentially and you can specify multiple filters separated by a /. The filter string KeyEquals(type,app)/ValueContains(retgits) would first perform a Filter by key and filter the result even further by applying the Filter by value

Documentation

Overview

Package tomlreader implements activities to read and query TOML files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewActivity

func NewActivity(metadata *activity.Metadata) activity.Activity

NewActivity creates a new activity

Types

type MyActivity

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

MyActivity is a stub for your Activity implementation

func (*MyActivity) Eval

func (a *MyActivity) Eval(context activity.Context) (done bool, err error)

Eval implements activity.Activity.Eval

func (*MyActivity) Metadata

func (a *MyActivity) Metadata() *activity.Metadata

Metadata implements activity.Activity.Metadata

Jump to

Keyboard shortcuts

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