Files
.examples
.github
alerting
api
client
config
controller
core
ui
condition.go
condition_bench_test.go
condition_result.go
condition_test.go
dns.go
dns_test.go
endpoint.go
endpoint_common.go
endpoint_common_test.go
endpoint_status.go
endpoint_status_test.go
endpoint_test.go
event.go
event_test.go
external_endpoint.go
external_endpoint_test.go
result.go
result_test.go
ssh.go
ssh_test.go
uptime.go
docs
jsonpath
metrics
pattern
security
storage
test
testdata
util
watchdog
web
.dockerignore
.gitattributes
.gitignore
Dockerfile
LICENSE
Makefile
README.md
config.yaml
go.mod
go.sum
main.go
gatus/core/ssh.go
TwiN f54c45e20e feat: Implement push-based external endpoints ()
* refactor: Move SSH outside of endpoint.go
* refactor: Use pointers for Alert receivers
* feat: Implement push-based external endpoints
* Fix failing tests
* Validate external endpoints on start
* Add tests for external endpoints
* refactor some error equality checks
* Improve docs and refactor some code
* Fix UI-related issues with external endpoints
2024-04-08 21:00:40 -04:00

30 lines
855 B
Go

package core
import (
"errors"
)
var (
// ErrEndpointWithoutSSHUsername is the error with which Gatus will panic if an endpoint with SSH monitoring is configured without a user.
ErrEndpointWithoutSSHUsername = errors.New("you must specify a username for each SSH endpoint")
// ErrEndpointWithoutSSHPassword is the error with which Gatus will panic if an endpoint with SSH monitoring is configured without a password.
ErrEndpointWithoutSSHPassword = errors.New("you must specify a password for each SSH endpoint")
)
type SSH struct {
Username string `yaml:"username,omitempty"`
Password string `yaml:"password,omitempty"`
}
// validate validates the endpoint
func (s *SSH) validate() error {
if len(s.Username) == 0 {
return ErrEndpointWithoutSSHUsername
}
if len(s.Password) == 0 {
return ErrEndpointWithoutSSHPassword
}
return nil
}