utils

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStalePidfile = errors.New("stale pidfile detected")
)

Functions

func CheckPidfile added in v0.3.2

func CheckPidfile(pidFilename string) (bool, error)

CheckPidfile reads a PID from the specified file and verifies if a process with that PID is running. Returns os.ErrNotExist if the pidfile does not exist, otherwise returns an error wrapped in utils.ErrCheckPidfile if an error occurred during the check or utils.ErrStalePidfile if the PID file is stale.

func ObservableCloseHandler added in v0.3.3

func ObservableCloseHandler(name string, log zerolog.Logger) func()

func ObservableErrorHandler added in v0.3.3

func ObservableErrorHandler(name string, log zerolog.Logger) func(error)

func TrimWithEllipsis

func TrimWithEllipsis(toTrim string, trimLength int) string

TrimWithEllipsis trims a string if it is longer than trimLength and appends an ellipsis if the string was trimmed

Types

type ErrCheckPidfile added in v0.3.2

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

func (ErrCheckPidfile) Error added in v0.3.2

func (e ErrCheckPidfile) Error() string

func (ErrCheckPidfile) Unwrap added in v0.3.2

func (e ErrCheckPidfile) Unwrap() error

Jump to

Keyboard shortcuts

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