kubernetes.v0: gopkg.in/kubernetes/kubernetes.v0/pkg/client/record Index | Files

package record

import "gopkg.in/kubernetes/kubernetes.v0/pkg/client/record"

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

Index

Package Files

doc.go event.go events_cache.go fake.go

type EventBroadcaster Uses

type EventBroadcaster interface {
    // StartEventWatcher starts sending events recieved from this EventBroadcaster to the given
    // event handler function. The return value can be ignored or used to stop recording, if
    // desired.
    StartEventWatcher(eventHandler func(*api.Event)) watch.Interface

    // StartRecordingToSink starts sending events recieved from this EventBroadcaster to the given
    // sink. The return value can be ignored or used to stop recording, if desired.
    StartRecordingToSink(sink EventSink) watch.Interface

    // StartLogging starts sending events recieved from this EventBroadcaster to the given logging
    // function. The return value can be ignored or used to stop recording, if desired.
    StartLogging(logf func(format string, args ...interface{})) watch.Interface

    // NewRecorder returns an EventRecorder that can be used to send events to this EventBroadcaster
    // with the event source set to the given event source.
    NewRecorder(source api.EventSource) EventRecorder
}

EventBroadcaster knows how to receive events and send them to any EventSink, watcher, or log.

func NewBroadcaster Uses

func NewBroadcaster() EventBroadcaster

Creates a new event broadcaster.

type EventRecorder Uses

type EventRecorder interface {
    // Event constructs an event from the given information and puts it in the queue for sending.
    // 'object' is the object this event is about. Event will make a reference-- or you may also
    // pass a reference to the object directly.
    // 'reason' is the reason this event is generated. 'reason' should be short and unique; it 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.
    Event(object runtime.Object, reason, message string)

    // Eventf is just like Event, but with Sprintf for the message field.
    Eventf(object runtime.Object, reason, messageFmt string, args ...interface{})

    // PastEventf is just like Eventf, but with an option to specify the event's 'timestamp' field.
    PastEventf(object runtime.Object, timestamp util.Time, reason, messageFmt string, args ...interface{})
}

EventRecorder knows how to record events on behalf of an EventSource.

type EventSink Uses

type EventSink interface {
    Create(event *api.Event) (*api.Event, error)
    Update(event *api.Event) (*api.Event, error)
}

EventSink 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.

type FakeRecorder Uses

type FakeRecorder struct{}

FakeRecorder is used as a fake during tests.

func (*FakeRecorder) Event Uses

func (f *FakeRecorder) Event(object runtime.Object, reason, message string)

func (*FakeRecorder) Eventf Uses

func (f *FakeRecorder) Eventf(object runtime.Object, reason, messageFmt string, args ...interface{})

func (*FakeRecorder) PastEventf Uses

func (f *FakeRecorder) PastEventf(object runtime.Object, timestamp util.Time, reason, messageFmt string, args ...interface{})

Package record imports 12 packages (graph). Updated 2016-07-25. Refresh now. Tools for package owners.