package monitor import ( "fmt" ct "github.com/google/certificate-transparency-go" ) // ErrorFetch occurs if there's a problem hitting the log's HTTP API. An STH is // provided if available, since it might carry evidence of some log misbehavior. type ErrorFetch struct { URL string Msg string Err error STH *ct.SignedTreeHead } func (e ErrorFetch) Error() string { return fmt.Sprintf("%s: %s: %v", e.URL, e.Msg, e.Err) } // ErrorMerkleTree occurs if the log's Merkle tree can't be verified. An STH is // provided if available (i.e., won't be available for internal tree building). type ErrorMerkleTree struct { URL string Msg string Err error STH *ct.SignedTreeHead } func (e ErrorMerkleTree) Error() string { return fmt.Sprintf("%s: %s: %v", e.URL, e.Msg, e.Err) } // TODO: MMD violations // TODO: Growing read-only logs // noout implements the Logger interface to discard unwanted output type noout struct{} func (n *noout) Printf(string, ...interface{}) {}