Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Host is the host to monitor
Host string `json:"host"`
// Port is the Port to monitor
Port uint64 `json:"port"`
// Protocol is the protocol to use
Protocol NetworkProtocol `json:"protocol"`
}
Config is the config for the Port monitor
type JSONConfig ¶
type JSONConfig struct {
monitors.JSONBaseConfig
Host string `json:"host"`
Port uint64 `json:"port"`
Protocol NetworkProtocol `json:"protocol"`
}
JSONConfig is the config for the Ping monitor
type Monitor ¶
type Monitor struct {
monitors.BaseMonitor
Config *Config
}
Monitor is a monitor that monitors ports it implements the Monitor interface
func (*Monitor) GetConfig ¶
func (m *Monitor) GetConfig() interface{}
GetConfig returns the config for the monitor
func (*Monitor) GetNotificationBody ¶
func (m *Monitor) GetNotificationBody(state *monitors.State) *monitors.NotificationBody
GetNotificationBody returns the notification body
type NetworkProtocol ¶
type NetworkProtocol string
NetworkProtocol returns the network protocol
const ( // TCP is the tcp protocol TCP NetworkProtocol = "tcp" // UDP is the udp protocol UDP NetworkProtocol = "udp" )
func (NetworkProtocol) GetProtocol ¶
func (n NetworkProtocol) GetProtocol(p string) NetworkProtocol
GetProtocol returns the protocol Defaults to tcp
func (NetworkProtocol) String ¶
func (n NetworkProtocol) String() string
String returns the string representation of the protocol
Click to show internal directories.
Click to hide internal directories.