utils

package
v1.3.8 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProcDir = "/proc"
)

Variables

View Source
var SharedLogger = NewLogger()

Functions

func FindPidWithName

func FindPidWithName(name string) int

Types

type Cmd

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

func NewCmd

func NewCmd(name string, args ...string) *Cmd

func NewTimeoutCmd

func NewTimeoutCmd(timeout time.Duration, name string, args ...string) *Cmd

func (*Cmd) Process

func (this *Cmd) Process() *os.Process

func (*Cmd) RawStderr

func (this *Cmd) RawStderr() string

func (*Cmd) RawStdout

func (this *Cmd) RawStdout() string

func (*Cmd) Run

func (this *Cmd) Run() error

func (*Cmd) Start

func (this *Cmd) Start() error

func (*Cmd) Stderr

func (this *Cmd) Stderr() string

func (*Cmd) Stdout

func (this *Cmd) Stdout() string

func (*Cmd) String

func (this *Cmd) String() string

func (*Cmd) Wait

func (this *Cmd) Wait() error

func (*Cmd) WithDir

func (this *Cmd) WithDir(dir string) *Cmd

func (*Cmd) WithEnv

func (this *Cmd) WithEnv(env []string) *Cmd

func (*Cmd) WithStderr

func (this *Cmd) WithStderr() *Cmd

func (*Cmd) WithStdout

func (this *Cmd) WithStdout() *Cmd

func (*Cmd) WithTimeout

func (this *Cmd) WithTimeout(timeout time.Duration) *Cmd

type Logger

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

func NewLogger

func NewLogger() *Logger

func (*Logger) Push

func (this *Logger) Push(msg string)

func (*Logger) ReadAll

func (this *Logger) ReadAll() (msgList []string)

func (*Logger) Reset

func (this *Logger) Reset()

type ProgressWriter

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

func NewProgressWriter

func NewProgressWriter(rawWriter io.Writer, total int64) *ProgressWriter

func (*ProgressWriter) Progress

func (this *ProgressWriter) Progress() float32

func (*ProgressWriter) Write

func (this *ProgressWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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