command

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 27, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunCommand

func RunCommand(c Command, taskSet []tasks.Task, wg *sync.WaitGroup) (err error)

RunCommand run all items in task lists against RunCommand

Types

type Command

type Command struct {
	Input    string
	Command  string
	Slots    int64
	Config   Config
	Sequence int64
	Empty    bool
}

Command a command

func NewCommand

func NewCommand(value string, taskListSet *tasks.TaskListSet, config Config) Command

NewCommand create a new command struct instance

func (*Command) Copy

func (c *Command) Copy() (newCommand Command)

Copy get copy of a command to avoid overwriting the source copy of the Command attribute

func (*Command) Execute

func (c *Command) Execute() (err error)

Execute execute a shell command For now, returns the stdout and stderr. Sends stdout and stderr to system stdout and stderr. func (c *Command) Execute() (stdout, stdErr string, err error) {

func (*Command) GetSequence

func (c *Command) GetSequence() int64

GetSequence get lock free sequence value

func (Command) GetSlotNumber

func (c Command) GetSlotNumber() int64

GetSlotNumber get slot number based on sequence and concurrency

func (*Command) Prepare

func (c *Command) Prepare(tasks []tasks.Task) (err error)

Prepare replace placeholders with data from incoming

func (*Command) Print

func (c *Command) Print(file *os.File, str string)

Print send to output

func (*Command) SequenceIncr

func (c *Command) SequenceIncr()

SequenceIncr increment sequence without lock

func (*Command) SequenceReset

func (c *Command) SequenceReset()

SequenceReset reset sequence

func (*Command) SetConcurrency

func (c *Command) SetConcurrency(concurrency int64)

SetConcurrency allow concurrency to be set

type Config

type Config struct {
	Awk         *awk.Command // awk script to use
	Slots       int64
	DryRun      bool
	KeepOrder   bool
	Concurrency int64
	PrintEmpty  bool
	ExitOnError bool
	StdIn       bool
}

Config config parameters

Jump to

Keyboard shortcuts

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