removefile

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2018 License: BSD-3-Clause Imports: 3 Imported by: 0

README

Remove File

This activity allows you to remove a file or a directory. With the option recursive, it is possible to remove a directory and his content.

Installation

Flogo Web
Start

Start a container of Flogo Web UI :

docker run --name flogo -it -d -p 3303:3303 -e FLOGO_NO_ENGINE_RECREATION=false flogo/flogo-docker eula-accept

The environment variable FLOGO_NO_ENGINE_RECREATION=false allows to force import of installed contributions.

Installation of the activity

To install the activity into the started container :

docker exec -it flogo sh -c 'cd /tmp/flogo-web/build/server/local/engines/flogo-web && flogo install github.com/square-it/flogo-contrib-activities/removefile'

Restart the container

docker restart flogo
Flogo CLI
flogo install github.com/square-it/flogo-contrib-activities/removefile

Schema

Inputs and Outputs:

{
  "inputs":[
    {
      "name": "path",
      "type": "string"
    },
    {
      "name":"recursive",
      "type":"boolean",
      "value": false
    }
  ],
  "outputs": [
  ]
 }

Settings

Setting Required Description
directory False The path to be removed
recursive False If this field is set to true, remove recursively a directory. It has no impact for a file. This field defaults to false.

Examples

Remove a file
{
  "id": "removefile_1",
  "name": "Remove File",
  "description": "Remove a file or an directory",
  "activity": {
    "ref": "github.com/square-it/flogo-contrib-activities/removefile",
    "input": {
      "directory": "/tmp/file",
      "recursive": false
    }
  }
}
Remove a directory recursively
{
  "id": "removefile_1",
  "name": "Remove File",
  "description": "Remove a file or an directory",
  "activity": {
    "ref": "github.com/square-it/flogo-contrib-activities/removefile",
    "input": {
      "directory": "/tmp/dir",
      "recursive": true
    }
  }
}

Documentation

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 RemoveFileActivity

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

RemoveFileActivity is a stub for your Activity implementation

func (*RemoveFileActivity) Eval

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

Eval implements activity.Activity.Eval

func (*RemoveFileActivity) Metadata

func (a *RemoveFileActivity) 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