exec

package
v0.0.0-...-900104f Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: LGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executable

type Executable interface {
	Run() (string, error)
	RunWithArgs(...string) (string, error)
}

func New

func New(line string) (Executable, error)

type Fifo

type Fifo struct {
	Path string
}

func (*Fifo) Run

func (f *Fifo) Run() (string, error)

func (*Fifo) RunWithArgs

func (f *Fifo) RunWithArgs(args ...string) (string, error)

type ShellScript

type ShellScript struct {
	Executable string
}

ShellScript might be either:

  • the path to an executable
  • an executable in path
  • a shell command with its argument

func (*ShellScript) Present

func (s *ShellScript) Present() bool

Present indicates if the value has been filled in into the config

func (*ShellScript) Run

func (s *ShellScript) Run() (string, error)

Run tries to execute the command, first looking for a corresponding executable and invoking it, then invoking the string as a command followed by its parameters.

func (*ShellScript) RunCheckSuccess

func (s *ShellScript) RunCheckSuccess(args ...string) (bool, error)

RunCheckSuccess executes the script with the given arguments and returns true if execution has been successful, false otherwise.

func (*ShellScript) RunWithArgs

func (s *ShellScript) RunWithArgs(args ...string) (string, error)

RunWithArgs executes the script using the provided strings as parameters.

func (*ShellScript) String

func (s *ShellScript) String() string

func (*ShellScript) UnmarshalText

func (s *ShellScript) UnmarshalText(text []byte) error

Jump to

Keyboard shortcuts

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