Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EventBus ¶
type EventBus interface { // Start starts watcher and its informer Start(<-chan struct{}) error // Subscribe registers a subscription to receive vents published for a specific key. Subscribe(key string, ch TestrunChannel) EventBusHandle // Unsubscribe removes the subscription from a key with the unique handle. Unsubscribe(key string, h EventBusHandle) // Publish sends a update to all registered subscription for the specific key. Publish(key string, tr *tmv1beta1.Testrun) // Has checks if the given is subscribed by anyone. Has(key string) bool // Subscriptions returns a list of all watched keys. Subscriptions() []string }
func NewEventBus ¶
type EventBusHandle ¶
type EventBusHandle *int
type Informer ¶
type Informer interface { // Start starts watcher and its informer Start(ctx context.Context) error // WaitForCacheSync waits for all the caches to sync. Returns false if it could not sync a informer. WaitForCacheSync(ctx context.Context) bool // InjectEventBus injects the the event bus instance of the watch InjectEventBus(eb EventBus) // Client returns the used k8s client. Client() client.Client }
Informer is the internal watch that interacts with the cluster and publishes events to the event bus.
type InformerType ¶
type InformerType string
InformerType is the type of informer to be used.
const CachedInformerType InformerType = "cached"
CachedInformerType specifies the cached informer type.
const PollingInformerType InformerType = "polling"
PollingInformerType specifies the polling informer type.
type Options ¶
type Options struct { // Scheme is the scheme Scheme *runtime.Scheme // InformerType is the type of the informer that should be used. InformerType InformerType // SyncPeriod is the minimum time where resources are reconciled // Only relevant if the cached informer should be used SyncPeriod *time.Duration // PollInterval is the time where informer polls the apiserver for an update. // Only relevant if the polling informer is used. PollInterval *time.Duration // Namespace restrict the namespace to watch. // Leave this value empty to watch all namespaces. Namespace string }
type TestrunChannel ¶
type Watch ¶
type Watch interface { // Watch registers a watch for a testrun resource until the testrun is completed Watch(namespace, name string, f WatchFunc) error WatchUntil(timeout time.Duration, namespace, name string, f WatchFunc) error Client() client.Client // Start starts watcher and its informer Start(ctx context.Context) error // WaitForCacheSync waits for all the caches to sync. Returns false if it could not sync a informer. WaitForCacheSync(ctx context.Context) bool }
Click to show internal directories.
Click to hide internal directories.