Documentation
¶
Overview ¶
// // Create a remote (cluster).
remote := &watch.Remote{
RestCfg: restCfg,
}
// // Create a remote (cluster) with relay to a controller.
remote := &watch.Remote{
RestCfg: restCfg,
Relay: watch.Relay{
Controller: controller,
Object: object,
}
}
// // Add watch(s) and start the remote. remote.Start(
watch.Watch{
Object: &v1.Pod{},
Predicates: []predicate{
&predicate{},
},
Object: &v1.Secret{},
Predicates: []predicate{
&predicate{},
},
})
// // Shutdown the remote. remote.Shutdown()
// // Add individual watch. remote.Watch(
&source.Kind{
Type: &v1.Secret{},
},
&MyPredicate{})
// // Register your remote. watch.Map.Add(myObject, remote)
// // Find a registered remote. remote, found := watch.Map.Find(myObject)
// // Unregister a registered remote. remote, found := watch.Map.Delete(myObject)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Forward ¶
type Forward struct {
// An event channel.
Channel chan event.GenericEvent
// An event to be forwarded.
Event event.GenericEvent
}
Predicate used to forward events. This MUST be the last predicated listed on a watch.
type Relay ¶
type Relay struct {
// Target controller.
Controller controller.Controller
// Object (resource) reconciled by the controller.
Object Resource
// contains filtered or unexported fields
}
Controller relay.
type Remote ¶
type Remote struct {
// A name.
Name string
// REST configuration
RestCfg *rest.Config
// Relay (forward) watch events.
Relay *Relay
// contains filtered or unexported fields
}
Represents a remote cluster.
Click to show internal directories.
Click to hide internal directories.