...

Source file src/github.com/letsencrypt/boulder/observer/observer.go

Documentation: github.com/letsencrypt/boulder/observer

     1  package observer
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/letsencrypt/boulder/cmd"
     7  	blog "github.com/letsencrypt/boulder/log"
     8  	_ "github.com/letsencrypt/boulder/observer/probers/crl"
     9  	_ "github.com/letsencrypt/boulder/observer/probers/dns"
    10  	_ "github.com/letsencrypt/boulder/observer/probers/http"
    11  	_ "github.com/letsencrypt/boulder/observer/probers/tls"
    12  )
    13  
    14  // Observer is the steward of goroutines started for each `monitor`.
    15  type Observer struct {
    16  	logger   blog.Logger
    17  	monitors []*monitor
    18  	shutdown func(ctx context.Context)
    19  }
    20  
    21  // Start spins off a goroutine for each monitor, and waits for a signal to exit
    22  func (o Observer) Start() {
    23  	for _, mon := range o.monitors {
    24  		go mon.start(o.logger)
    25  	}
    26  
    27  	defer o.shutdown(context.Background())
    28  	cmd.WaitForSignal()
    29  }
    30  

View as plain text