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