local_command

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

README

Local command plugin

You can run commands on the localhost with this plugin

plugin configuration

provider:
  local_command:
    plugin: local_command # name of the plugin
    config: # configurations for this plugin
      timeout: 2m  # default timeout
      error: # if error occurs what should be the action
        record: true  # record the error
        dir: ./logs/local_command # directory location to save the error details
        filename: errors.txt # filename to save the error details

provider template configuration

command example

executes the commands on the localhost

command: sleep  # command to be executed
args:   # arguments to the above command
  - "10"
timeout: 11s    # terminates the tasks, if hits the timeout duration
output: # logs location
  dir: ./logs/sleep_cmd
  filename: sleep.txt
  append: false # would you like to append data with existing logs (if any)
script example

executes the script on the local host

script: |   # multiline script sample
  echo 'hello world'
  echo 'script example'
timeout: 30s
output:
  dir: './logs/script'
  filename: url.txt
  append: false

Documentation

Index

Constants

View Source
const (
	PluginName = "local_command"
)

Variables

This section is empty.

Functions

func New

func New(config map[string]interface{}) (providerPluginTY.Plugin, error)

Types

type LocalCommand

type LocalCommand struct {
	Config localCmdTY.ProviderConfig
}

func (*LocalCommand) Close

func (lc *LocalCommand) Close() error

func (*LocalCommand) Execute

func (lc *LocalCommand) Execute(task *templateTY.Task) (interface{}, error)

func (*LocalCommand) Name

func (lc *LocalCommand) Name() string

func (*LocalCommand) Start

func (lc *LocalCommand) Start() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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