aboutsummaryrefslogtreecommitdiff
path: root/service_config.go
diff options
context:
space:
mode:
Diffstat (limited to 'service_config.go')
-rw-r--r--service_config.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/service_config.go b/service_config.go
index 9f9e0fc..b1261fa 100644
--- a/service_config.go
+++ b/service_config.go
@@ -26,24 +26,27 @@ const defInterval = 10 * time.Second
type ServiceConfig struct {
scanURL *url.URL
- Name string
+ // ID of service, derived from config file without ".cfg" extension.
+ ID string
+
+ Name string `ini:"service::name"`
// The Address of service, using scheme based, for example
// - http://example.com/health for HTTP service,
// - tcp://127.0.0.1:22 for TCP service,
// - udp://127.0.0.1:53 for UDP service.
- Address string `ini:"::address"`
+ Address string `ini:"service::address"`
// HTTPMethod define HTTP method to be used to scan the HTTP service.
// Valid value is either DELETE, GET, HEAD, PATCH, POST, or PUT.
- HTTPMethod string `ini:"::method"`
+ HTTPMethod string `ini:"service::method"`
// Timeout for connecting and reading response from service.
- Timeout string `ini:"::timeout"`
+ Timeout string `ini:"service::timeout"`
// Interval between each scan.
// The minimum value is 60 seconds or 1 minute.
- Interval string `ini:"::interval"`
+ Interval string `ini:"service::interval"`
timeout time.Duration
interval time.Duration