nezha/model/monitor.go

30 lines
355 B
Go

package model
import (
pb "github.com/naiba/nezha/proto"
)
const (
_ = iota
TaskTypeHTTPGET
TaskTypeICMPPing
TaskTypeTCPPing
TaskTypeCommand
)
type Monitor struct {
Common
Name string
Type uint8
Target string
Notify bool
}
func (m *Monitor) PB() *pb.Task {
return &pb.Task{
Id: m.ID,
Type: uint64(m.Type),
Data: m.Target,
}
}