Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultInfoCheckPoint = 100 DefaultCrawlerMaxErrThreshold = 20 // Monitorable Defaults DefaultWindowLength = 5 DefaultMaxErrThreshold = 4 DefaultMonitorableInterval = 45 * time.Second )
View Source
const (
DefaultMaxSize = 100
)
Variables ¶
View Source
var (
ErrMaxSizeLessThan0 = errors.New("max size must be > 0")
)
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { MaxSize int Monitorable []json.RawMessage }
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
func (Config) HydratedWithDefaults ¶
func (Config) ReadMaxSize ¶
type Crawler ¶
type Crawler struct { sync.Mutex Monitorable []*Monitorable InfoCheckPoint int ErrCount int MaxErrThreshold int EventChan chan (Monitorable) ErrChan chan (error) Finished chan (bool) // contains filtered or unexported fields }
func NewCrawlerFromConfig ¶
func NewCrawlerFromConfig() *Crawler
func (*Crawler) Add ¶
func (c *Crawler) Add(m *Monitorable) int
func (*Crawler) Remove ¶
func (c *Crawler) Remove(m *Monitorable) bool
func (*Crawler) RemovePosition ¶
type Monitorable ¶
type Monitorable struct { URL string Status bool StatusWindow []bool WindowLength int MaxErrThreshold int Interval time.Duration NextCheck *time.Time LastChecked *time.Time Protocol Protocol // contains filtered or unexported fields }
func NewMonitorable ¶
func NewMonitorable() *Monitorable
func (*Monitorable) AddStatus ¶
func (m *Monitorable) AddStatus(status bool) int
func (*Monitorable) ErrThresholdExceeded ¶
func (m *Monitorable) ErrThresholdExceeded() bool
func (*Monitorable) ShouldCheck ¶
func (m *Monitorable) ShouldCheck() bool
Click to show internal directories.
Click to hide internal directories.