2020-08-11 17:14:57 +00:00
|
|
|
/*
|
|
|
|
Copyright 2020 VMware, Inc.
|
|
|
|
SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
package testutil
|
|
|
|
|
2020-08-28 15:59:09 +00:00
|
|
|
import "github.com/suzerain-io/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
|
|
|
|
}
|