cmd

package
v0.1.48 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveArgsWithName

func RemoveArgsWithName(args []string, name string) []string

RemoveArgsWithName removes all args from the list where there is the word name, it return new slice

func RunCommand

func RunCommand(c string, params ...string) error

RunCommand runs the command cmd with params, returns an error if any

Types

type PidFile

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

func NewPidFile

func NewPidFile(fn string) *PidFile

NewPidFile creates new PidFile struct by the file name

func (*PidFile) Interrupt

func (pf *PidFile) Interrupt() error

Interrupt tries to read the pid file and interrupt the process by its Pid, if possible

func (*PidFile) Lock

func (pf *PidFile) Lock() bool

Lock tries to acquire the pid file and write the current process Id there. Returns true, if the operaion was successful.

func (*PidFile) ReadPid

func (pf *PidFile) ReadPid() (int, error)

ReadPid tries to read the pid file and returns pid value, if possible

func (*PidFile) Unlock

func (pf *PidFile) Unlock()

Unlock releases resources acquired by Lock.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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