nezha/model/monitor.go
2021-01-16 00:45:49 +08:00

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,
}
}