monitor

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ProcessName                     string        `yaml:"processName"`
	PollInterval                    time.Duration `yaml:"pollInterval"`
	UnavailabilityThreshold         int           `yaml:"unavailabilityThreshold"`
	CloseBlackDesertWhenUnavailable bool          `yaml:"closeBlackDesertWhenUnavailable"`
	Telegram                        struct {
		Token  string `yaml:"token"`
		UserId int    `yaml:"userId"`
	}
}

func ConfigFromFile

func ConfigFromFile(filePath string) (*Config, error)

func (*Config) Validate

func (config *Config) Validate() error

type ProcessMonitor

type ProcessMonitor struct {
	// contains filtered or unexported fields
}

func New

func New(config *Config, logger *log.Logger) (*ProcessMonitor, error)

func (*ProcessMonitor) Start

func (pm *ProcessMonitor) Start() error

func (*ProcessMonitor) Status

func (pm *ProcessMonitor) Status() error

func (*ProcessMonitor) Stop

func (pm *ProcessMonitor) Stop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL