Documentation
¶
Index ¶
- type BrokerBuilder
- func (b *BrokerBuilder) BackoffDelay(backoffDelay *string) *BrokerBuilder
- func (b *BrokerBuilder) BackoffPolicy(policyType *v1.BackoffPolicyType) *BrokerBuilder
- func (b *BrokerBuilder) Build() *eventingv1.Broker
- func (b *BrokerBuilder) Class(class string) *BrokerBuilder
- func (b *BrokerBuilder) Config(config *duckv1.KReference) *BrokerBuilder
- func (b *BrokerBuilder) DlSink(dlSink *duckv1.Destination) *BrokerBuilder
- func (b *BrokerBuilder) Namespace(ns string) *BrokerBuilder
- func (b *BrokerBuilder) Retry(retry *int32) *BrokerBuilder
- func (b *BrokerBuilder) RetryAfterMax(max *string) *BrokerBuilder
- func (b *BrokerBuilder) Timeout(timeout *string) *BrokerBuilder
- func (b *BrokerBuilder) WithGvk() *BrokerBuilder
- type BrokerUpdateFunc
- type EventingRecorder
- func (sr *EventingRecorder) CreateBroker(broker interface{}, err error)
- func (sr *EventingRecorder) CreateTrigger(trigger interface{}, err error)
- func (sr *EventingRecorder) DeleteBroker(name, timeout interface{}, err error)
- func (sr *EventingRecorder) DeleteTrigger(name interface{}, err error)
- func (sr *EventingRecorder) GetBroker(name interface{}, broker *eventingv1.Broker, err error)
- func (sr *EventingRecorder) GetTrigger(name interface{}, trigger *eventingv1.Trigger, err error)
- func (sr *EventingRecorder) ListBrokers(brokerList *eventingv1.BrokerList, err error)
- func (sr *EventingRecorder) ListTriggers(triggerList *eventingv1.TriggerList, err error)
- func (sr *EventingRecorder) UpdateBroker(broker *eventingv1.Broker, err error)
- func (sr *EventingRecorder) UpdateTrigger(trigger interface{}, err error)
- func (sr *EventingRecorder) Validate()
- type KnEventingClient
- type MockKnEventingClient
- func (c *MockKnEventingClient) CreateBroker(ctx context.Context, broker *eventingv1.Broker) error
- func (c *MockKnEventingClient) CreateTrigger(ctx context.Context, trigger *eventingv1.Trigger) error
- func (c *MockKnEventingClient) DeleteBroker(ctx context.Context, name string, timeout time.Duration) error
- func (c *MockKnEventingClient) DeleteTrigger(ctx context.Context, name string) error
- func (c *MockKnEventingClient) GetBroker(ctx context.Context, name string) (*eventingv1.Broker, error)
- func (c *MockKnEventingClient) GetTrigger(ctx context.Context, name string) (*eventingv1.Trigger, error)
- func (c *MockKnEventingClient) ListBrokers(context.Context) (*eventingv1.BrokerList, error)
- func (c *MockKnEventingClient) ListTriggers(context.Context) (*eventingv1.TriggerList, error)
- func (c *MockKnEventingClient) Namespace() string
- func (c *MockKnEventingClient) Recorder() *EventingRecorder
- func (c *MockKnEventingClient) UpdateBroker(ctx context.Context, broker *eventingv1.Broker) error
- func (c *MockKnEventingClient) UpdateBrokerWithRetry(ctx context.Context, name string, updateFunc BrokerUpdateFunc, nrRetries int) error
- func (c *MockKnEventingClient) UpdateTrigger(ctx context.Context, trigger *eventingv1.Trigger) error
- func (c *MockKnEventingClient) UpdateTriggerWithRetry(ctx context.Context, name string, updateFunc TriggerUpdateFunc, nrRetries int) error
- type TriggerBuilder
- func (b *TriggerBuilder) Broker(broker string) *TriggerBuilder
- func (b *TriggerBuilder) Build() *eventingv1.Trigger
- func (b *TriggerBuilder) Filters(filters map[string]string) *TriggerBuilder
- func (b *TriggerBuilder) InjectBroker(inject bool) *TriggerBuilder
- func (b *TriggerBuilder) Namespace(ns string) *TriggerBuilder
- func (b *TriggerBuilder) Subscriber(subscriber *duckv1.Destination) *TriggerBuilder
- func (b *TriggerBuilder) WithGvk() *TriggerBuilder
- type TriggerUpdateFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrokerBuilder ¶
type BrokerBuilder struct {
// contains filtered or unexported fields
}
BrokerBuilder is for building the broker
func NewBrokerBuilder ¶
func NewBrokerBuilder(name string) *BrokerBuilder
NewBrokerBuilder for building broker object
func NewBrokerBuilderFromExisting ¶
func NewBrokerBuilderFromExisting(broker *eventingv1.Broker) *BrokerBuilder
NewBrokerBuilderFromExisting returns broker builder from original broker
func (*BrokerBuilder) BackoffDelay ¶
func (b *BrokerBuilder) BackoffDelay(backoffDelay *string) *BrokerBuilder
BackoffDelay for the broker builder
func (*BrokerBuilder) BackoffPolicy ¶
func (b *BrokerBuilder) BackoffPolicy(policyType *v1.BackoffPolicyType) *BrokerBuilder
BackoffPolicy for the broker builder
func (*BrokerBuilder) Build ¶
func (b *BrokerBuilder) Build() *eventingv1.Broker
Build to return an instance of broker object
func (*BrokerBuilder) Class ¶
func (b *BrokerBuilder) Class(class string) *BrokerBuilder
Class for broker builder
func (*BrokerBuilder) Config ¶
func (b *BrokerBuilder) Config(config *duckv1.KReference) *BrokerBuilder
Config for the broker builder
func (*BrokerBuilder) DlSink ¶
func (b *BrokerBuilder) DlSink(dlSink *duckv1.Destination) *BrokerBuilder
DlSink for the broker builder
func (*BrokerBuilder) Namespace ¶
func (b *BrokerBuilder) Namespace(ns string) *BrokerBuilder
Namespace for broker builder
func (*BrokerBuilder) Retry ¶
func (b *BrokerBuilder) Retry(retry *int32) *BrokerBuilder
Retry for the broker builder
func (*BrokerBuilder) RetryAfterMax ¶
func (b *BrokerBuilder) RetryAfterMax(max *string) *BrokerBuilder
RetryAfterMax for the broker builder
func (*BrokerBuilder) Timeout ¶
func (b *BrokerBuilder) Timeout(timeout *string) *BrokerBuilder
Timeout for the broker builder
func (*BrokerBuilder) WithGvk ¶
func (b *BrokerBuilder) WithGvk() *BrokerBuilder
WithGvk add the GVK coordinates for read tests
type BrokerUpdateFunc ¶
type BrokerUpdateFunc func(origBroker *eventingv1.Broker) (*eventingv1.Broker, error)
type EventingRecorder ¶
type EventingRecorder struct {
// contains filtered or unexported fields
}
EventingRecorder is recorder for eventing objects
func (*EventingRecorder) CreateBroker ¶
func (sr *EventingRecorder) CreateBroker(broker interface{}, err error)
CreateBroker records a call for CreateBroker with the expected error
func (*EventingRecorder) CreateTrigger ¶
func (sr *EventingRecorder) CreateTrigger(trigger interface{}, err error)
CreateTrigger records a call for CreatePingSource with the expected error
func (*EventingRecorder) DeleteBroker ¶
func (sr *EventingRecorder) DeleteBroker(name, timeout interface{}, err error)
DeleteBroker records a call for DeleteBroker with the expected error (nil if none)
func (*EventingRecorder) DeleteTrigger ¶
func (sr *EventingRecorder) DeleteTrigger(name interface{}, err error)
DeleteTrigger records a call for DeleteTrigger with the expected error (nil if none)
func (*EventingRecorder) GetBroker ¶
func (sr *EventingRecorder) GetBroker(name interface{}, broker *eventingv1.Broker, err error)
GetBroker records a call for GetBroker with the expected object or error. Either trigger or err should be nil
func (*EventingRecorder) GetTrigger ¶
func (sr *EventingRecorder) GetTrigger(name interface{}, trigger *eventingv1.Trigger, err error)
GetTrigger records a call for GetTrigger with the expected object or error. Either trigger or err should be nil
func (*EventingRecorder) ListBrokers ¶
func (sr *EventingRecorder) ListBrokers(brokerList *eventingv1.BrokerList, err error)
ListBrokers records a call for ListBrokers with the expected result and error (nil if none)
func (*EventingRecorder) ListTriggers ¶
func (sr *EventingRecorder) ListTriggers(triggerList *eventingv1.TriggerList, err error)
ListTriggers records a call for ListTriggers with the expected result and error (nil if none)
func (*EventingRecorder) UpdateBroker ¶
func (sr *EventingRecorder) UpdateBroker(broker *eventingv1.Broker, err error)
UpdateBroker records a call for UpdateBroker with the expected result and error (nil if none)
func (*EventingRecorder) UpdateTrigger ¶
func (sr *EventingRecorder) UpdateTrigger(trigger interface{}, err error)
UpdateTrigger records a call for UpdateTrigger with the expected result and error (nil if none)
func (*EventingRecorder) Validate ¶
func (sr *EventingRecorder) Validate()
Validate validates whether every recorded action has been called
type KnEventingClient ¶
type KnEventingClient interface { // Namespace in which this client is operating for Namespace() string // CreateTrigger is used to create an instance of trigger CreateTrigger(ctx context.Context, trigger *eventingv1.Trigger) error // DeleteTrigger is used to delete an instance of trigger DeleteTrigger(ctx context.Context, name string) error // GetTrigger is used to get an instance of trigger GetTrigger(ctx context.Context, name string) (*eventingv1.Trigger, error) // ListTriggers returns list of trigger CRDs ListTriggers(ctx context.Context) (*eventingv1.TriggerList, error) // UpdateTrigger is used to update an instance of trigger UpdateTrigger(ctx context.Context, trigger *eventingv1.Trigger) error // UpdateTriggerWithRetry is used to update an instance of trigger UpdateTriggerWithRetry(ctx context.Context, name string, updateFunc TriggerUpdateFunc, nrRetries int) error // CreateBroker is used to create an instance of broker CreateBroker(ctx context.Context, broker *eventingv1.Broker) error // GetBroker is used to get an instance of broker GetBroker(ctx context.Context, name string) (*eventingv1.Broker, error) // DeleteBroker is used to delete an instance of broker DeleteBroker(ctx context.Context, name string, timeout time.Duration) error // ListBrokers returns list of broker CRDs ListBrokers(ctx context.Context) (*eventingv1.BrokerList, error) // UpdateBroker is used to update an instance of broker UpdateBroker(ctx context.Context, broker *eventingv1.Broker) error // UpdateBrokerWithRetry is used to update an instance of broker UpdateBrokerWithRetry(ctx context.Context, name string, updateFunc BrokerUpdateFunc, nrRetries int) error }
KnEventingClient to Eventing Sources. All methods are relative to the namespace specified during construction
func NewKnEventingClient ¶
func NewKnEventingClient(client clientv1.EventingV1Interface, namespace string) KnEventingClient
NewKnEventingClient is to invoke Eventing Sources Client API to create object
type MockKnEventingClient ¶
type MockKnEventingClient struct {
// contains filtered or unexported fields
}
MockKnEventingClient is a combine of test object and recorder
func NewMockKnEventingClient ¶
func NewMockKnEventingClient(t *testing.T, ns ...string) *MockKnEventingClient
NewMockKnEventingClient returns a new mock instance which you need to record for
func (*MockKnEventingClient) CreateBroker ¶
func (c *MockKnEventingClient) CreateBroker(ctx context.Context, broker *eventingv1.Broker) error
CreateBroker performs a previously recorded action
func (*MockKnEventingClient) CreateTrigger ¶
func (c *MockKnEventingClient) CreateTrigger(ctx context.Context, trigger *eventingv1.Trigger) error
CreateTrigger performs a previously recorded action
func (*MockKnEventingClient) DeleteBroker ¶
func (c *MockKnEventingClient) DeleteBroker(ctx context.Context, name string, timeout time.Duration) error
DeleteBroker performs a previously recorded action, failing if non has been registered
func (*MockKnEventingClient) DeleteTrigger ¶
func (c *MockKnEventingClient) DeleteTrigger(ctx context.Context, name string) error
DeleteTrigger performs a previously recorded action, failing if non has been registered
func (*MockKnEventingClient) GetBroker ¶
func (c *MockKnEventingClient) GetBroker(ctx context.Context, name string) (*eventingv1.Broker, error)
GetBroker performs a previously recorded action
func (*MockKnEventingClient) GetTrigger ¶
func (c *MockKnEventingClient) GetTrigger(ctx context.Context, name string) (*eventingv1.Trigger, error)
GetTrigger performs a previously recorded action
func (*MockKnEventingClient) ListBrokers ¶
func (c *MockKnEventingClient) ListBrokers(context.Context) (*eventingv1.BrokerList, error)
ListBrokers performs a previously recorded action
func (*MockKnEventingClient) ListTriggers ¶
func (c *MockKnEventingClient) ListTriggers(context.Context) (*eventingv1.TriggerList, error)
ListTriggers performs a previously recorded action
func (*MockKnEventingClient) Namespace ¶
func (c *MockKnEventingClient) Namespace() string
Namespace of this client
func (*MockKnEventingClient) Recorder ¶
func (c *MockKnEventingClient) Recorder() *EventingRecorder
Recorder returns the recorder for registering API calls
func (*MockKnEventingClient) UpdateBroker ¶
func (c *MockKnEventingClient) UpdateBroker(ctx context.Context, broker *eventingv1.Broker) error
func (*MockKnEventingClient) UpdateBrokerWithRetry ¶
func (c *MockKnEventingClient) UpdateBrokerWithRetry(ctx context.Context, name string, updateFunc BrokerUpdateFunc, nrRetries int) error
func (*MockKnEventingClient) UpdateTrigger ¶
func (c *MockKnEventingClient) UpdateTrigger(ctx context.Context, trigger *eventingv1.Trigger) error
UpdateTrigger performs a previously recorded action
func (*MockKnEventingClient) UpdateTriggerWithRetry ¶
func (c *MockKnEventingClient) UpdateTriggerWithRetry(ctx context.Context, name string, updateFunc TriggerUpdateFunc, nrRetries int) error
type TriggerBuilder ¶
type TriggerBuilder struct {
// contains filtered or unexported fields
}
TriggerBuilder is for building the trigger
func NewTriggerBuilder ¶
func NewTriggerBuilder(name string) *TriggerBuilder
NewTriggerBuilder for building trigger object
func NewTriggerBuilderFromExisting ¶
func NewTriggerBuilderFromExisting(trigger *eventingv1.Trigger) *TriggerBuilder
NewTriggerBuilderFromExisting for building the object from existing Trigger object
func (*TriggerBuilder) Broker ¶
func (b *TriggerBuilder) Broker(broker string) *TriggerBuilder
Broker to set the broker of trigger object
func (*TriggerBuilder) Build ¶
func (b *TriggerBuilder) Build() *eventingv1.Trigger
Build to return an instance of trigger object
func (*TriggerBuilder) Filters ¶
func (b *TriggerBuilder) Filters(filters map[string]string) *TriggerBuilder
func (*TriggerBuilder) InjectBroker ¶
func (b *TriggerBuilder) InjectBroker(inject bool) *TriggerBuilder
InjectBroker to add annotation to setup default broker
func (*TriggerBuilder) Namespace ¶
func (b *TriggerBuilder) Namespace(ns string) *TriggerBuilder
Namespace for this trigger
func (*TriggerBuilder) Subscriber ¶
func (b *TriggerBuilder) Subscriber(subscriber *duckv1.Destination) *TriggerBuilder
Subscriber for the trigger to send to (it's a Sink actually)
func (*TriggerBuilder) WithGvk ¶
func (b *TriggerBuilder) WithGvk() *TriggerBuilder
WithGvk sets the GVK for the triggers (which otherwise remains empty
type TriggerUpdateFunc ¶
type TriggerUpdateFunc func(origTrigger *eventingv1.Trigger) (*eventingv1.Trigger, error)