Repository: kubernetes/kubernetes
File: staging/src/k8s.io/client-go/tools/cache/delta_fifo.go (Go)

Code before:
// DeltaType is the type of a change (addition, deletion, etc)
type DeltaType string

// Change type definition
const (
	Added   DeltaType = "Added"
	Updated DeltaType = "Updated"
	Deleted DeltaType = "Deleted"
	// Replaced is emitted when we encountered watch errors and had to do a
	// relist, or on initial listing of objects. We don't know if the replaced
	// object has changed.
	//
	// NOTE: Previous versions of DeltaFIFO would use Sync for Replace events
	// as well. Hence, Replaced is only emitted when the option
	// EmitDeltaTypeReplaced is true.
	Replaced DeltaType = "Replaced"
	// ReplacedAll is emitted when we encountered watch errors and had to do
	// a relist, or on initial listing of objects. This is the same reason as
	// Replaced but will be emitted instead when the FIFO supports atomic
	// replacement. This event will return the full list of replaced items
	// instead of a single object.
	ReplacedAll DeltaType = "ReplacedAll"
	// Sync is for synthetic events during a periodic resync.
	Sync DeltaType = "Sync"
	// SyncAll is to trigger a resync of the entire queue. This event will
	// encapsulate the SyncInfo type instead of an object.
	SyncAll DeltaType = "SyncAll"
)

// Delta is a member of Deltas (a list of Delta objects) which
// in its turn is the type stored by a DeltaFIFO. It tells you what
// change happened, and the object's state after* that change.
//
// [*] Unless the change is a deletion, and then you'll get the final
// state of the object before it was deleted.
type Delta struct {
	Type   DeltaType
	Object interface{}
}

// Deltas is a list of one or more 'Delta's to an individual object.
// The oldest delta is at index 0, the newest delta is the last one.
type Deltas []Delta

// NewDeltaFIFO returns a Queue which can be used to process changes to items.
//
// keyFunc is used to figure out what key an object should have. (It is
// exposed in the returned DeltaFIFO's KeyOf() method, with additional handling
// around deleted objects and queue state).
//
// 'knownObjects' may be supplied to modify the behavior of Delete,

Review comment (suggestion):
```suggestion
	// SyncAll indicates all known objects should be reprocessed.
	// This event contains an object of type SyncAllInfo.
```

Code after:
// DeltaType is the type of a change (addition, deletion, etc)
type DeltaType string

// Change type definition
const (
	Added   DeltaType = "Added"
	Updated DeltaType = "Updated"
	Deleted DeltaType = "Deleted"
	// Replaced is emitted when we encountered watch errors and had to do a
	// relist, or on initial listing of objects. We don't know if the replaced
	// object has changed.
	//
	// NOTE: Previous versions of DeltaFIFO would use Sync for Replace events
	// as well. Hence, Replaced is only emitted when the option
	// EmitDeltaTypeReplaced is true.
	Replaced DeltaType = "Replaced"
	// ReplacedAll is emitted when we encountered watch errors and had to do
	// a relist, or on initial listing of objects. This is the same reason as
	// Replaced but will be emitted instead when the FIFO supports atomic
	// replacement. This event will return the full list of replaced items
	// instead of a single object.
	ReplacedAll DeltaType = "ReplacedAll"
	// Sync is for synthetic events during a periodic resync.
	Sync DeltaType = "Sync"
	// SyncAll indicates all known objects should be reprocessed.
	// This event contains an object of type SyncAllInfo.
	SyncAll DeltaType = "SyncAll"
)

// Delta is a member of Deltas (a list of Delta objects) which
// in its turn is the type stored by a DeltaFIFO. It tells you what
// change happened, and the object's state after* that change.
//
// [*] Unless the change is a deletion, and then you'll get the final
// state of the object before it was deleted.
type Delta struct {
	Type   DeltaType
	Object interface{}
}

// Deltas is a list of one or more 'Delta's to an individual object.
// The oldest delta is at index 0, the newest delta is the last one.
type Deltas []Delta

// NewDeltaFIFO returns a Queue which can be used to process changes to items.
//
// keyFunc is used to figure out what key an object should have. (It is
// exposed in the returned DeltaFIFO's KeyOf() method, with additional handling
// around deleted objects and queue state).
//
// 'knownObjects' may be supplied to modify the behavior of Delete,