utils

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstNonEmpty

func FirstNonEmpty(str1, str2 string) string

func GetBool added in v0.9.0

func GetBool(m map[string]any, key string, defaultValue bool) bool

func GetString added in v0.9.0

func GetString(m map[string]any, key string, defaultValue string) string

func MapToEnvList

func MapToEnvList(env map[string]string) []string

MapToEnvList converts a map to a slice of "key=value" strings.

func SendSignalToPIDFile

func SendSignalToPIDFile(pidFile string, sig syscall.Signal) error

SendSignalToPIDFile sends a signal to the process identified by the PID file

func SplitByMultipleDelimiters added in v0.8.2

func SplitByMultipleDelimiters(s string, delimiters ...string) []string

Types

type PIDManager

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

PIDManager handles PID file operations

func NewPIDManager

func NewPIDManager(pidFile string) *PIDManager

NewPIDManager creates a new PIDManager instance

func NewPIDManagerFromConfig

func NewPIDManagerFromConfig(pidFile string) *PIDManager

NewPIDManagerFromConfig creates a new PIDManager instance from config

func (*PIDManager) GetPIDFile

func (p *PIDManager) GetPIDFile() string

GetPIDFile returns the PID file path

func (*PIDManager) RemovePID

func (p *PIDManager) RemovePID() error

RemovePID removes the PID file

func (*PIDManager) WritePID

func (p *PIDManager) WritePID() error

WritePID writes the current process ID to the PID file

Jump to

Keyboard shortcuts

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