kubernetesk8s.io/kubernetes/pkg/watch/json Index | Files

package json

import "k8s.io/kubernetes/pkg/watch/json"

Package json implements a simple encoder and decoder for streams of watch events over io.Writer/Readers

Index

Functions

func Object

func Object(encoder runtime.Encoder, event *watch.Event) (interface{}, error)

Object converts a watch.Event into an appropriately serializable JSON object

Types

type WatchEvent

type WatchEvent struct {
	// The type of the watch event; added, modified, deleted, or error.
	// +optional
	Type watch.EventType `json:"type,omitempty" description:"the type of watch event; may be ADDED, MODIFIED, DELETED, or ERROR"`

	// For added or modified objects, this is the new object; for deleted objects,
	// it's the state of the object immediately prior to its deletion.
	// For errors, it's an api.Status.
	// +optional
	Object runtime.RawExtension `json:"object,omitempty" description:"the object being watched; will match the type of the resource endpoint or be a Status object if the type is ERROR"`
}

WatchEvent objects are streamed from the api server in response to a watch request. These are not API objects and may not be changed in a backward-incompatible way. TODO: move to a public, versioned object now that RawExtension conversions are possible in the schema.

Source Files

doc.go types.go

Version
v1.12.7
Published
Mar 22, 2019
Platform
js/wasm
Imports
5 packages
Last checked
53 seconds ago

Tools for package owners.