mirror of
https://github.com/ribbybibby/ssl_exporter.git
synced 2026-05-23 16:52:46 +00:00
There are a number of reasons for this change: - Modules allow a single instance of the exporter to be configured with numerous different tls configs. Previously you had to run a different exporter for each combination. - Adding new and more complicated options to the exporter should be easier with modules than if I was to go down the route of accepting configuration directly through url params - I prefer defining a specific prober (https,tcp) over using the URL to guess what the user wants
21 lines
399 B
Go
21 lines
399 B
Go
package prober
|
|
|
|
import (
|
|
"crypto/tls"
|
|
"time"
|
|
|
|
"github.com/ribbybibby/ssl_exporter/config"
|
|
)
|
|
|
|
var (
|
|
// Probers maps a friendly name to a corresponding probe function
|
|
Probers = map[string]ProbeFn{
|
|
"https": ProbeHTTPS,
|
|
"http": ProbeHTTPS,
|
|
"tcp": ProbeTCP,
|
|
}
|
|
)
|
|
|
|
// ProbeFn probes
|
|
type ProbeFn func(target string, module config.Module, timeout time.Duration) (*tls.ConnectionState, error)
|