Documentation
¶
Index ¶
- Constants
- Variables
- func ParseDuration(s string) (time.Duration, error)
- func TCPDailer(hostaddr string, proxyaddr *Proxy, timeout time.Duration) (net.Conn, error)
- type Cache
- type CertValues
- func GetCert(servername, param, proto string, timeout time.Duration, proxy *Proxy) (*CertValues, error)
- func GetCertCMD(servername, command string, timeout time.Duration) (*CertValues, error)
- func GetCertFile(servername, path string) (*CertValues, error)
- func GetCertIMAP(servername, port string, timeout time.Duration, proxy *Proxy) (*CertValues, error)
- func GetCertSMTP(servername, port string, timeout time.Duration, proxy *Proxy) (*CertValues, error)
- func GetCertTLS(servername, port string, timeout time.Duration, proxy *Proxy) (*CertValues, error)
- func GetCertificate(conn net.Conn, hostname string, timeout time.Duration) (*CertValues, error)
- type Config
- type ConfigEntry
- type EmailData
- type LineReader
- type LogLine
- type Logger
- type Proxy
- type Report
- func (rep *Report) Error(err string)
- func (rep *Report) Generate(config *Config)
- func (rep *Report) GetCert(servername, port, proto string, timeout time.Duration, proxy *Proxy) (*CertValues, error)
- func (rep *Report) LogError(sc *ServerCheck)
- func (rep *Report) LogStatus(sc *ServerCheck)
- func (rep *Report) SendReport(ce ConfigEntry)
- func (rep *Report) Status(s string)
- func (rep *Report) VerifyCert(sc *ServerCheck, timeout time.Duration) error
- type SMTPConfig
- type ServerCheck
Constants ¶
const ( MsgError = 0 MsgStatus = 1 MsgLogError = 2 MsgLogStatus = 3 )
Variables ¶
Functions ¶
func ParseDuration ¶
ParseDuration parses a duration string. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache caches call results.
type CertValues ¶
type CertValues struct {
Hostname string // Hostname used for retrieval connection.
Expire time.Time // Time this certificate expires.
VerifyError error // Any TLS errors when connecting.
Hash string // Hash of the raw certificate.
Certificate *x509.Certificate
}
CertValues contains the relevant aspects of a certificate.
func GetCert ¶
func GetCert(servername, param, proto string, timeout time.Duration, proxy *Proxy) (*CertValues, error)
GetCert returns the server certificate's expiry time. Proto is tls/ssl, imap, smtp.
func GetCertCMD ¶
func GetCertCMD(servername, command string, timeout time.Duration) (*CertValues, error)
GetCertCMD runs a command and interpretes the standard output as a certificate.
func GetCertFile ¶
func GetCertFile(servername, path string) (*CertValues, error)
GetCertFile verifies a file
func GetCertIMAP ¶
GetCertIMAP returns the expiration date of an IMAP STARTTLS cert.
func GetCertSMTP ¶
GetCertSMTP returns the expiration date of an SMTP STARTTLS cert.
func GetCertTLS ¶
GetCertTLS returns the server certificate's expiry time for a TLS server.
func GetCertificate ¶
GetCertificate returns the server certificate's expiry time. conn is an established connection. hostname is the hostname of the remote server.
type Config ¶
type Config struct {
Tests []ConfigEntry
Mail *SMTPConfig
}
type ConfigEntry ¶
type ConfigEntry struct {
MailTo string
NumChecks int
Alert bool
Checks []ServerCheck
}
type EmailData ¶
type EmailData struct {
From string
Report ConfigEntry
}
type LineReader ¶
type LineReader struct {
// contains filtered or unexported fields
}
LineReader helps with dealing with text protocols on the network.
func NewLineReader ¶
func NewLineReader(r io.Reader) *LineReader
NewLineReader returns r as a LineReader
func (LineReader) Line ¶
func (lr LineReader) Line() ([]byte, error)
Line returns the next newline terminated line.
func (LineReader) ReadNumeric ¶
func (lr LineReader) ReadNumeric() (code, message string, cont bool, err error)
ReadNumeric reads SMTP-like text protocol lines. Code contains the numeric code, if any. message contains the remainder of the line. cont signals if more lines should be read.
func (LineReader) ReadNumericContinuous ¶
func (lr LineReader) ReadNumericContinuous() (code string, messages []string, err error)
ReadNumericContinuous continues to read until the server expects a message.
type Report ¶
type Report struct {
Workers int
Timeout time.Duration
UseCache bool
Logger *Logger
MailTemplate []byte
MailHostname string
MailPort string
MailFrom string
MailUsername string
MailPassword string
// contains filtered or unexported fields
}
func (*Report) LogError ¶
func (rep *Report) LogError(sc *ServerCheck)
func (*Report) LogStatus ¶
func (rep *Report) LogStatus(sc *ServerCheck)
func (*Report) SendReport ¶
func (rep *Report) SendReport(ce ConfigEntry)
func (*Report) VerifyCert ¶
func (rep *Report) VerifyCert(sc *ServerCheck, timeout time.Duration) error
type SMTPConfig ¶
func ParseSMTPLine ¶
func ParseSMTPLine(l string) (*SMTPConfig, error)
func (*SMTPConfig) Copy ¶
func (sc *SMTPConfig) Copy() *SMTPConfig
type ServerCheck ¶
type ServerCheck struct {
Hostname string
Param string
Protocol string
Deadline time.Duration
Hash string
ReturnHash string
Error []error
ExecuteError error
ExpireTime time.Time
Proxy *Proxy
KeyS, KeyC int // used internally
}
func ParseServerLine ¶
func ParseServerLine(l string) (*ServerCheck, error)
func (ServerCheck) Copy ¶
func (sc ServerCheck) Copy() ServerCheck
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
certexpire
command
|
|
|
wcex
command
|
|
|
wcex/stringduration
Package stringduration extends formatting for durations as strings.
|
Package stringduration extends formatting for durations as strings. |