Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KillAllByName ¶ added in v0.0.4
KillAllByName kills all running processes that match the given executable name This is useful for cleanup when multiple instances might be running
Types ¶
type Config ¶ added in v0.0.7
type Config struct {
ExecProgramPath string // eg: "server/main.exe"
RunArguments func() []string // eg: []string{"dev"}
ExitChan chan bool
Logger func(message ...any)
KillAllOnStop bool // If true, kills all instances of the executable when stopping
WorkingDir string // eg: "/path/to/working/dir"
}
type GoRun ¶
func (*GoRun) GetPID ¶ added in v0.0.4
GetPID returns the process ID if the program is running, otherwise returns 0
func (*GoRun) RunProgram ¶
func (*GoRun) StopProgram ¶
func (*GoRun) StopProgramAndCleanup ¶ added in v0.0.4
StopProgramAndCleanup stops the current program and optionally kills all instances of the same executable name
type SafeBuffer ¶ added in v0.0.5
type SafeBuffer struct {
// contains filtered or unexported fields
}
SafeBuffer provides thread-safe operations on a bytes.Buffer and optionally forwards writes to a function logger
func NewSafeBuffer ¶ added in v0.0.5
func NewSafeBuffer() *SafeBuffer
NewSafeBuffer creates a new thread-safe buffer
func NewSafeBufferWithForward ¶ added in v0.0.5
func NewSafeBufferWithForward(forward func(message ...any)) *SafeBuffer
NewSafeBufferWithForward creates a new thread-safe buffer that forwards writes
func (*SafeBuffer) Len ¶ added in v0.0.5
func (sb *SafeBuffer) Len() int
Len returns the length of the buffer in a thread-safe manner
func (*SafeBuffer) Reset ¶ added in v0.0.5
func (sb *SafeBuffer) Reset()
Reset resets the buffer in a thread-safe manner
func (*SafeBuffer) String ¶ added in v0.0.5
func (sb *SafeBuffer) String() string
String returns the contents of the buffer as a string in a thread-safe manner