Documentation
¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func ParseWatchResourceVersion ¶
ParseWatchResourceVersion ParseWatchResourceVersion
Types ¶
type Event ¶
Event represents a single event to a watched resource.
func (Event) GetPreValueString ¶
GetPreValueString GetPreValueString
type Interface ¶
type Interface interface {
// Stops watching. Will close the channel returned by ResultChan(). Releases
// any resources used by the watch.
Stop()
// Returns a chan which will receive all the events. If an error occurs
// or Stop() is called, this channel will be closed, in which case the
// watch should be completely cleaned up.
ResultChan() <-chan Event
}
Interface can be implemented by anything that knows how to watch and report changes.
type Object ¶
type Object interface {
}
Object All Watcher types registered with Scheme must support the Object interface.
type Status ¶
type Status struct {
// Status of the operation.
// One of: "Success" or "Failure".
// +optional
Status string `json:"status,omitempty"`
// A human-readable description of the status of this operation.
// +optional
Message string `json:"message,omitempty"`
// A machine-readable description of why this operation is in the
// "Failure" status. If this value is empty there
// is no information available. A Reason clarifies an HTTP status
// code but does not override it.
// +optional
Reason string `json:"reason,omitempty"`
// Extended data associated with the reason. Each reason may define its
// own extended details. This field is optional and the data returned
// is not guaranteed to conform to any schema except that defined by
// the reason type.
// +optional
Details *string `json:"details,omitempty" `
// Suggested HTTP return code for this status, 0 if not set.
// +optional
Code int32 `json:"code,omitempty"`
}
Status is a return value for calls that don't return other objects.
type Watch ¶
type Watch interface {
// Watch begins watching the specified key. Events are decoded into API objects,
// and any items selected by 'p' are sent down to returned watch.Interface.
// resourceVersion may be used to specify what version to begin watching,
// which should be the current resourceVersion, and no longer rv+1
// (e.g. reconnecting without missing any updates).
// If resource version is "0", this interface will get current object at given key
// and send it in an "ADDED" event, before watch starts.
Watch(ctx context.Context, key string, resourceVersion string) (Interface, error)
// WatchList begins watching the specified key's items. Items are decoded into API
// objects and any item selected by 'p' are sent down to returned watch.Interface.
// resourceVersion may be used to specify what version to begin watching,
// which should be the current resourceVersion, and no longer rv+1
// (e.g. reconnecting without missing any updates).
// If resource version is "0", this interface will list current objects directory defined by key
// and send them in "ADDED" events, before watch starts.
WatchList(ctx context.Context, key string, resourceVersion string) (Interface, error)
}
Watch offers a common interface for object marshaling/unmarshaling operations and hides all the storage-related operations behind it.
Click to show internal directories.
Click to hide internal directories.