mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 20:58:14 -05:00
28 lines
334 B
Go
28 lines
334 B
Go
package model
|
|
|
|
import (
|
|
pb "github.com/naiba/nezha/proto"
|
|
)
|
|
|
|
const (
|
|
_ = iota
|
|
MonitorTypeHTTPGET
|
|
MonitorTypeICMPPing
|
|
MonitorTypeTCPPing
|
|
)
|
|
|
|
type Monitor struct {
|
|
Common
|
|
Name string
|
|
Type uint8
|
|
Target string
|
|
}
|
|
|
|
func (m *Monitor) PB() *pb.Task {
|
|
return &pb.Task{
|
|
Id: m.ID,
|
|
Type: uint64(m.Type),
|
|
Data: m.Target,
|
|
}
|
|
}
|