cmd

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2018 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Overview

Package cmd provides default implementation for command-line-like actions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResyncAction

type ResyncAction struct {
	ServiceName string
	Path        string
	DryRun      bool
	CrtTask     *jobs.Task
}

func (*ResyncAction) GetName

func (c *ResyncAction) GetName() string

Unique identifier

func (*ResyncAction) Init

func (c *ResyncAction) Init(job *jobs.Job, cl client.Client, action *jobs.Action) error

Pass parameters

func (*ResyncAction) Run

Run the actual action code

func (*ResyncAction) SetTask

func (c *ResyncAction) SetTask(task *jobs.Task)

Implement TaskUpdaterDelegateAction as the target service will update the task status on its side.

type RpcAction

type RpcAction struct {
	Client      client.Client
	ServiceName string
	MethodName  string
	JsonRequest interface{}
}

func (*RpcAction) GetName

func (c *RpcAction) GetName() string

Unique identifier

func (*RpcAction) Init

func (c *RpcAction) Init(job *jobs.Job, cl client.Client, action *jobs.Action) error

Pass parameters

func (*RpcAction) Run

Run the actual action code

type ShellAction

type ShellAction struct {
	Client          client.Client
	Router          *views.Router
	CmdBin          string
	CmdParameters   []string
	TemporaryFolder string
	ExitOnError     bool

	// Input via tmp file or via StdIn
	StreamToStdIn      bool
	UseTemporaryFolder bool
	// Output (if any) from tmp file or from StdOut
	OutputNodePlaceHolder string
	StreamFromStdOut      bool
	// Output result
	ResultPlaceHolder string
}

func (*ShellAction) GetName

func (c *ShellAction) GetName() string

Unique identifier

func (*ShellAction) Init

func (c *ShellAction) Init(job *jobs.Job, cl client.Client, action *jobs.Action) error

Pass parameters

func (*ShellAction) Run

Run the actual action code

type WGetAction

type WGetAction struct {
	Router    *views.Router
	SourceUrl *url.URL
}

WGetAction performs a wget command with the provided URL

func (*WGetAction) GetName

func (w *WGetAction) GetName() string

GetName returns the unique identifier of this action

func (*WGetAction) Init

func (w *WGetAction) Init(job *jobs.Job, cl client.Client, action *jobs.Action) error

Init passes parameters

func (*WGetAction) Run

Run the actual action code

Jump to

Keyboard shortcuts

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