Skip to content

Commit

Permalink
doc: add godocs
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrMatsko committed Dec 11, 2024
1 parent 874069d commit 9b37ece
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions notifier/alive_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ import (
"github.com/moira-alert/moira/metrics"
)

// AliveWatcher is responsible for checking notifier state and marking notifier.alive metrics.
type AliveWatcher struct {
logger moira.Logger
database moira.Database
config Config
notifierMetrics *metrics.NotifierMetrics
}

// NewAliveWatcher is an initializer for AliveWatcher.
func NewAliveWatcher(
logger moira.Logger,
database moira.Database,
Expand All @@ -29,6 +31,8 @@ func NewAliveWatcher(
}
}

// Start starts the checking loop in separate goroutine.
// Use context.WithCancel, context.WithTimeout etc. to terminate check loop.
func (watcher *AliveWatcher) Start(ctx context.Context) {
go watcher.stateChecker(ctx)
}
Expand Down

0 comments on commit 9b37ece

Please sign in to comment.