package incident
import "github.com/google/monologue/incident"
Package incident provides access to functionality for recording and classifying compliance incidents.
Index ¶
- type LoggingReporter
- func (l *LoggingReporter) LogUpdate(ctx context.Context, baseURL, summary, fullURL, details string)
- func (l *LoggingReporter) LogUpdatef(ctx context.Context, baseURL, summary, fullURL, detailsFmt string, args ...interface{})
- func (l *LoggingReporter) LogViolation(ctx context.Context, baseURL, summary, fullURL, details string)
- func (l *LoggingReporter) LogViolationf(ctx context.Context, baseURL, summary, fullURL, detailsFmt string, args ...interface{})
- type Reporter
Types ¶
type LoggingReporter ¶
type LoggingReporter struct { }
LoggingReporter implements the Reporter interface by simply emitting log messages.
func (*LoggingReporter) LogUpdate ¶
func (l *LoggingReporter) LogUpdate(ctx context.Context, baseURL, summary, fullURL, details string)
LogUpdate emits a log message for the incident details.
func (*LoggingReporter) LogUpdatef ¶
func (l *LoggingReporter) LogUpdatef(ctx context.Context, baseURL, summary, fullURL, detailsFmt string, args ...interface{})
LogUpdatef emits a log message for the incident details, formatting parameters along the way.
func (*LoggingReporter) LogViolation ¶
func (l *LoggingReporter) LogViolation(ctx context.Context, baseURL, summary, fullURL, details string)
LogViolation emits a log message for the incident details.
func (*LoggingReporter) LogViolationf ¶
func (l *LoggingReporter) LogViolationf(ctx context.Context, baseURL, summary, fullURL, detailsFmt string, args ...interface{})
LogUpdatef emits a log message for the incident details, formatting parameters along the way.
type Reporter ¶
type Reporter interface { // LogUpdate records a non-violation incident with the given parameters. // The baseURL, summary and category fields should be stable across // multiple similar incidents to allow aggregation. Information that // varies between instances of the 'same' incident should be included in // the fullURL or details field. LogUpdate(ctx context.Context, baseURL, summary, fullURL, details string) LogUpdatef(ctx context.Context, baseURL, summary, fullURL, detailsFmt string, args ...interface{}) // LogViolation records a RFC/Policy violation incident with the given parameters. LogViolation(ctx context.Context, baseURL, summary, fullURL, details string) LogViolationf(ctx context.Context, baseURL, summary, fullURL, detailsFmt string, args ...interface{}) }
Reporter describes a mechanism for recording compliance incidents.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
incident/mysql | Package mysql provides a MySQL based implementation of incident management. |
incident/testonly | Package testonly contains fakes for use in tests that interact with incident reporting. |
- Version
- v0.0.0-20230315160450-1dc62842925e (latest)
- Published
- Mar 15, 2023
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- now –
Tools for package owners.