Documentation
¶
Overview ¶
Package events is a small event logging system.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group is a grouping of log events going to a common Sink.
type Log ¶
type Log interface {
Printf(format string, v ...interface{})
Errorf(format string, v ...interface{})
// Finish should be called in a defer, right after FromContext.
Finish()
}
Log is the facade that "user" code should expect.
type Sink ¶
type Sink interface {
// StartGroup is called when a new group is created. The Context should only
// be used for the duration of the StartGroup call.
StartGroup(ctx context.Context, group string) error
// Topic notifies the Sink that a topic has been started. The same topic may
// be passed multiple times.
Topic(string)
// Event is called once per event, some time between StartGroup and
// FinishGroup.
Event(group, topic string, ev Event) error
// FinishGroup is called when the group is finished. The Context may be
// canceled when this method is called.
FinishGroup(ctx context.Context, group string) error
}
Sink is the interface that event sinks must implement.
Click to show internal directories.
Click to hide internal directories.