pkg

package
v0.0.0-...-15ddd31 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTopic

func CreateTopic(name string, brokers []string, config *tls.Config) error

func DeleteTopic

func DeleteTopic(name string, brokers []string, config *tls.Config) error

func GetTLSConfig

func GetTLSConfig(srvCertPath, keyPath, caPath string) (*tls.Config, error)

func NewReader

func NewReader(brokers []string, dialer *kafka.Dialer) *kafka.Reader

func OpenDB

func OpenDB(dsn string) (*sql.DB, error)

Types

type Monitor

type Monitor struct {
	Site    *models.Site
	Context context.Context
	Cancel  context.CancelFunc
	// contains filtered or unexported fields
}

Monitor represents the availability check for each site

func NewMonitor

func NewMonitor(s *models.Site, w *kafka.Writer) *Monitor

func (*Monitor) Start

func (m *Monitor) Start(wg *sync.WaitGroup)

Start starts the monitor for the site in a goroutine. The wait group operand is incremented and the monitoring results are published to a Kafka topic. Monitor periodicity is achieved with a ticker set to the specified interval for the site and will run until the monitor is cancelled when the HealthBee service ends.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳