Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DisableGlobalCleanup bool
DisableGlobalCleanup is a global flag to disable aggressive process killing (pgrep -f) in all gorun instances. This is primarily used in tests to protect the IDE.
Functions ¶
func KillAllByName ¶
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 ¶
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
DisableGlobalCleanup bool // If true, disables global cleanup (pgrep -f) even if KillAllOnStop is true
WorkingDir string // eg: "/path/to/working/dir"
}
type GoRun ¶
func (*GoRun) RunProgram ¶
func (*GoRun) StopProgram ¶
func (*GoRun) StopProgramAndCleanup ¶
StopProgramAndCleanup stops the current program and optionally kills all instances of the same executable name
type SafeBuffer ¶
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 ¶
func NewSafeBuffer() *SafeBuffer
NewSafeBuffer creates a new thread-safe buffer
func NewSafeBufferWithForward ¶
func NewSafeBufferWithForward(forward func(message ...any)) *SafeBuffer
NewSafeBufferWithForward creates a new thread-safe buffer that forwards writes
func (*SafeBuffer) Len ¶
func (sb *SafeBuffer) Len() int
Len returns the length of the buffer in a thread-safe manner
func (*SafeBuffer) Reset ¶
func (sb *SafeBuffer) Reset()
Reset resets the buffer in a thread-safe manner
func (*SafeBuffer) String ¶
func (sb *SafeBuffer) String() string
String returns the contents of the buffer as a string in a thread-safe manner