kubernetes: github.com/erikstmartin/kubernetes/pkg/client/record Index | Files

package record

import "github.com/erikstmartin/kubernetes/pkg/client/record"

Package record has all client logic for recording and reporting events.


Package Files

doc.go event.go

func Event Uses

func Event(object runtime.Object, fieldPath, status, reason, message string)

Event constructs an event from the given information and puts it in the queue for sending. 'object' is the object this event is about; 'fieldPath', if not "", locates a part of 'object'. 'status' is the new status of the object. 'reason' is the reason it now has this status. Both 'status' and 'reason' should be short and unique; they will be used to automate handling of events, so imagine people writing switch statements to handle them. You want to make that easy. 'message' is intended to be human readable.

The resulting event will be created in the same namespace as the reference object.

func Eventf Uses

func Eventf(object runtime.Object, fieldPath, status, reason, messageFmt string, args ...interface{})

Eventf is just like Event, but with Sprintf for the message field.

func GetEvents Uses

func GetEvents(f func(*api.Event)) watch.Interface

GetEvents lets you see *local* events. Convenience function for testing. The return value can be ignored or used to stop logging, if desired.

func StartLogging Uses

func StartLogging(logf func(format string, args ...interface{})) watch.Interface

StartLogging just logs local events, using the given logging function. The return value can be ignored or used to stop logging, if desired.

func StartRecording Uses

func StartRecording(recorder EventRecorder, sourceName string) watch.Interface

StartRecording starts sending events to recorder. Call once while initializing your binary. Subsequent calls will be ignored. The return value can be ignored or used to stop recording, if desired.

type EventRecorder Uses

type EventRecorder interface {
    Create(event *api.Event) (*api.Event, error)

EventRecorder knows how to store events (client.Client implements it.) EventRecorder must respect the namespace that will be embedded in 'event'.

Package record imports 7 packages (graph). Updated 2018-04-10. Refresh now. Tools for package owners.