{"modulePath":"github.com/dockerstack/kubernetes","version":"v0.20.1-0.20150627061651-1c0b765df6da","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package record\n\nPackage record has all client logic for recording and reporting events.\n\n## Types\n\n```go\ntype EventBroadcaster interface {\n\t// StartEventWatcher starts sending events recieved from this EventBroadcaster to the given\n\t// event handler function. The return value can be ignored or used to stop recording, if\n\t// desired.\n\tStartEventWatcher(eventHandler func(*api.Event)) watch.Interface\n\n\t// StartRecordingToSink starts sending events recieved from this EventBroadcaster to the given\n\t// sink. The return value can be ignored or used to stop recording, if desired.\n\tStartRecordingToSink(sink EventSink) watch.Interface\n\n\t// StartLogging starts sending events recieved from this EventBroadcaster to the given logging\n\t// function. The return value can be ignored or used to stop recording, if desired.\n\tStartLogging(logf func(format string, args ...interface{})) watch.Interface\n\n\t// NewRecorder returns an EventRecorder that can be used to send events to this EventBroadcaster\n\t// with the event source set to the given event source.\n\tNewRecorder(source api.EventSource) EventRecorder\n}\n```\nEventBroadcaster knows how to receive events and send them to any EventSink, watcher, or log.\n\n```go\nfunc NewBroadcaster() EventBroadcaster\n```\nCreates a new event broadcaster.\n\n```go\ntype EventRecorder interface {\n\t// Event constructs an event from the given information and puts it in the queue for sending.\n\t// 'object' is the object this event is about. Event will make a reference-- or you may also\n\t// pass a reference to the object directly.\n\t// 'reason' is the reason this event is generated. 'reason' should be short and unique; it will\n\t// be used to automate handling of events, so imagine people writing switch statements to\n\t// handle them. You want to make that easy.\n\t// 'message' is intended to be human readable.\n\t//\n\t// The resulting event will be created in the same namespace as the reference object.\n\tEvent(object runtime.Object, reason, message string)\n\n\t// Eventf is just like Event, but with Sprintf for the message field.\n\tEventf(object runtime.Object, reason, messageFmt string, args ...interface{})\n\n\t// PastEventf is just like Eventf, but with an option to specify the event's 'timestamp' field.\n\tPastEventf(object runtime.Object, timestamp util.Time, reason, messageFmt string, args ...interface{})\n}\n```\nEventRecorder knows how to record events on behalf of an EventSource.\n\n```go\ntype EventSink interface {\n\tCreate(event *api.Event) (*api.Event, error)\n\tUpdate(event *api.Event) (*api.Event, error)\n}\n```\nEventSink knows how to store events (client.Client implements it.) EventSink must respect the namespace that will be embedded in 'event'. It is assumed that EventSink will return the same sorts of errors as pkg/client's REST client.\n\n```go\ntype FakeRecorder struct{}\n```\nFakeRecorder is used as a fake during tests.\n\n```go\nfunc (f *FakeRecorder) Event(object runtime.Object, reason, message string)\n```\n\n```go\nfunc (f *FakeRecorder) Eventf(object runtime.Object, reason, messageFmt string, args ...interface{})\n```\n\n```go\nfunc (f *FakeRecorder) PastEventf(object runtime.Object, timestamp util.Time, reason, messageFmt string, args ...interface{})\n```\n\n","path":"github.com/dockerstack/kubernetes/pkg/client/record","name":"record","synopsis":"Package record has all client logic for recording and reporting events.","isRedistributable":true}
