Documentation
¶
Index ¶
- func Run(cfg *config.Config, opts ...WatchOption) error
- type ProcessManager
- func (pm *ProcessManager) GetBackoff() time.Duration
- func (pm *ProcessManager) GetDoneChan() <-chan struct{}
- func (pm *ProcessManager) GetLastLogTime() time.Time
- func (pm *ProcessManager) GetLogger() *logger.Logger
- func (pm *ProcessManager) GetPID() int
- func (pm *ProcessManager) IsRunning() bool
- func (pm *ProcessManager) SetBackoff(d time.Duration)
- func (pm *ProcessManager) SetLastLogTime(t time.Time)
- func (pm *ProcessManager) Start() error
- func (pm *ProcessManager) Stop() error
- type Processor
- type WatchOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ProcessManager ¶
type ProcessManager struct {
// contains filtered or unexported fields
}
func New ¶ added in v1.1.0
func New(cfg *config.Config) *ProcessManager
func (*ProcessManager) GetBackoff ¶ added in v1.1.0
func (pm *ProcessManager) GetBackoff() time.Duration
func (*ProcessManager) GetDoneChan ¶ added in v1.1.0
func (pm *ProcessManager) GetDoneChan() <-chan struct{}
func (*ProcessManager) GetLastLogTime ¶ added in v1.1.0
func (pm *ProcessManager) GetLastLogTime() time.Time
func (*ProcessManager) GetLogger ¶ added in v1.1.0
func (pm *ProcessManager) GetLogger() *logger.Logger
func (*ProcessManager) GetPID ¶ added in v1.4.0
func (pm *ProcessManager) GetPID() int
func (*ProcessManager) IsRunning ¶ added in v1.3.1
func (pm *ProcessManager) IsRunning() bool
func (*ProcessManager) SetBackoff ¶ added in v1.1.0
func (pm *ProcessManager) SetBackoff(d time.Duration)
func (*ProcessManager) SetLastLogTime ¶ added in v1.1.0
func (pm *ProcessManager) SetLastLogTime(t time.Time)
func (*ProcessManager) Start ¶
func (pm *ProcessManager) Start() error
func (*ProcessManager) Stop ¶
func (pm *ProcessManager) Stop() error
type Processor ¶ added in v1.1.0
type Processor interface {
Start() error
Stop() error
GetDoneChan() <-chan struct{}
GetBackoff() time.Duration
SetBackoff(d time.Duration)
GetLastLogTime() time.Time
SetLastLogTime(t time.Time)
GetLogger() *logger.Logger
IsRunning() bool
GetPID() int
}
Processor defines the interface for process management
type WatchOption ¶ added in v1.1.0
type WatchOption func(*watchOptions)
WatchOption configures the Watch function
func WithProcessManager ¶ added in v1.1.0
func WithProcessManager(pm Processor) WatchOption
WithProcessManager sets a custom process manager for testing
func WithRepository ¶ added in v1.1.0
func WithRepository(repo git.Repository) WatchOption
WithRepository sets a custom repository implementation
Click to show internal directories.
Click to hide internal directories.