mirror of https://github.com/statping/statping
commit
211ff3bdcf
|
@ -18,11 +18,11 @@ var (
|
|||
func (s *Service) Validate() error {
|
||||
if s.Name == "" {
|
||||
return errors.New("missing service name")
|
||||
} else if s.Domain == "" {
|
||||
} else if s.Domain == "" && s.Type != "static" {
|
||||
return errors.New("missing domain name")
|
||||
} else if s.Type == "" {
|
||||
return errors.New("missing service type")
|
||||
} else if s.Interval == 0 {
|
||||
} else if s.Interval == 0 && s.Type != "static" {
|
||||
return errors.New("missing check interval")
|
||||
}
|
||||
return nil
|
||||
|
|
|
@ -176,6 +176,7 @@ func Samples() error {
|
|||
|
||||
s7 := &Service{
|
||||
Name: "Static Service",
|
||||
Domain: "none",
|
||||
Type: "static",
|
||||
Order: 7,
|
||||
Public: null.NewNullBool(true),
|
||||
|
|
Loading…
Reference in New Issue