2020-09-16 14:19:51 +00:00
|
|
|
// Copyright 2020 the Pinniped contributors. All Rights Reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2020-08-11 17:14:57 +00:00
|
|
|
|
|
|
|
package testutil
|
|
|
|
|
2020-09-17 17:56:54 +00:00
|
|
|
import "github.com/vmware-tanzu/pinniped/internal/controllerlib"
|
2020-08-11 17:14:57 +00:00
|
|
|
|
|
|
|
type ObservableWithInitialEventOption struct {
|
2020-08-28 15:59:09 +00:00
|
|
|
key controllerlib.Key
|
2020-08-11 17:14:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func NewObservableWithInitialEventOption() *ObservableWithInitialEventOption {
|
|
|
|
return &ObservableWithInitialEventOption{}
|
|
|
|
}
|
|
|
|
|
2020-08-28 15:59:09 +00:00
|
|
|
func (i *ObservableWithInitialEventOption) WithInitialEvent(key controllerlib.Key) controllerlib.Option {
|
2020-08-11 17:14:57 +00:00
|
|
|
i.key = key
|
2020-08-28 15:59:09 +00:00
|
|
|
return controllerlib.WithInitialEvent(key)
|
2020-08-11 17:14:57 +00:00
|
|
|
}
|
|
|
|
|
2020-08-28 15:59:09 +00:00
|
|
|
func (i *ObservableWithInitialEventOption) GetInitialEventKey() controllerlib.Key {
|
2020-08-11 17:14:57 +00:00
|
|
|
return i.key
|
|
|
|
}
|