Documentation ¶
Index ¶
- type KnPingSourcesClient
- type KnSourcesClient
- type MockKnPingSourceClient
- func (c *MockKnPingSourceClient) CreatePingSource(ctx context.Context, pingSource *sourcesv1beta2.PingSource) error
- func (c *MockKnPingSourceClient) DeletePingSource(ctx context.Context, name string) error
- func (c *MockKnPingSourceClient) GetPingSource(ctx context.Context, name string) (*sourcesv1beta2.PingSource, error)
- func (c *MockKnPingSourceClient) ListPingSource(context.Context) (*sourcesv1beta2.PingSourceList, error)
- func (c *MockKnPingSourceClient) Namespace() string
- func (c *MockKnPingSourceClient) Recorder() *PingSourcesRecorder
- func (c *MockKnPingSourceClient) UpdatePingSource(ctx context.Context, pingSource *sourcesv1beta2.PingSource) error
- func (c *MockKnPingSourceClient) UpdatePingSourceWithRetry(ctx context.Context, name string, updateFunc PingSourceUpdateFunc, ...) error
- type PingSourceBuilder
- func (b *PingSourceBuilder) Build() *sourcesv1beta2.PingSource
- func (b *PingSourceBuilder) CloudEventOverrides(ceo map[string]string, toRemove []string) *PingSourceBuilder
- func (b *PingSourceBuilder) Data(data string) *PingSourceBuilder
- func (b *PingSourceBuilder) DataBase64(data string) *PingSourceBuilder
- func (b *PingSourceBuilder) Schedule(schedule string) *PingSourceBuilder
- func (b *PingSourceBuilder) Sink(sink duckv1.Destination) *PingSourceBuilder
- type PingSourceUpdateFunc
- type PingSourcesRecorder
- func (sr *PingSourcesRecorder) CreatePingSource(pingSource interface{}, err error)
- func (sr *PingSourcesRecorder) DeletePingSource(name interface{}, err error)
- func (sr *PingSourcesRecorder) GetPingSource(name interface{}, pingSource *sourcesv1beta2.PingSource, err error)
- func (sr *PingSourcesRecorder) ListPingSource(pingSourceList *sourcesv1beta2.PingSourceList, err error)
- func (sr *PingSourcesRecorder) UpdatePingSource(pingSource interface{}, err error)
- func (sr *PingSourcesRecorder) Validate()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KnPingSourcesClient ¶
type KnPingSourcesClient interface { // GetPingSource fetches a Ping source by its name GetPingSource(ctx context.Context, name string) (*sourcesv1beta2.PingSource, error) // CreatePingSource creates a Ping source CreatePingSource(ctx context.Context, pingSource *sourcesv1beta2.PingSource) error // UpdatePingSource updates a Ping source UpdatePingSource(ctx context.Context, pingSource *sourcesv1beta2.PingSource) error // UpdatePingSourceWithRetry updates a Ping source and retries on conflict UpdatePingSourceWithRetry(ctx context.Context, name string, updateFunc PingSourceUpdateFunc, nrRetries int) error // DeletePingSource deletes a Ping source DeletePingSource(ctx context.Context, name string) error // ListPingSource lists all Ping sources // TODO: Support list configs like in service list ListPingSource(ctx context.Context) (*sourcesv1beta2.PingSourceList, error) // Get namespace for this source Namespace() string }
Interface for interacting with a Ping source
type KnSourcesClient ¶
type KnSourcesClient interface { // Get client for Ping sources PingSourcesClient() KnPingSourcesClient }
KnSinkBindingClient to Eventing Sources. All methods are relative to the namespace specified during construction
func NewKnSourcesClient ¶
func NewKnSourcesClient(client clientv1beta2.SourcesV1beta2Interface, namespace string) KnSourcesClient
NewKnSourcesClient for managing all eventing built-in sources
type MockKnPingSourceClient ¶
type MockKnPingSourceClient struct {
// contains filtered or unexported fields
}
func NewMockKnPingSourceClient ¶
func NewMockKnPingSourceClient(t *testing.T, ns ...string) *MockKnPingSourceClient
NewMockKnPingSourceClient returns a new mock instance which you need to record for
func (*MockKnPingSourceClient) CreatePingSource ¶
func (c *MockKnPingSourceClient) CreatePingSource(ctx context.Context, pingSource *sourcesv1beta2.PingSource) error
CreatePingSource performs a previously recorded action, failing if non has been registered
func (*MockKnPingSourceClient) DeletePingSource ¶
func (c *MockKnPingSourceClient) DeletePingSource(ctx context.Context, name string) error
DeletePingSource performs a previously recorded action, failing if non has been registered
func (*MockKnPingSourceClient) GetPingSource ¶
func (c *MockKnPingSourceClient) GetPingSource(ctx context.Context, name string) (*sourcesv1beta2.PingSource, error)
GetPingSource performs a previously recorded action, failing if non has been registered
func (*MockKnPingSourceClient) ListPingSource ¶
func (c *MockKnPingSourceClient) ListPingSource(context.Context) (*sourcesv1beta2.PingSourceList, error)
ListPingSource performs a previously recorded action, failing if non has been registered
func (*MockKnPingSourceClient) Namespace ¶
func (c *MockKnPingSourceClient) Namespace() string
Namespace of this client
func (*MockKnPingSourceClient) Recorder ¶
func (c *MockKnPingSourceClient) Recorder() *PingSourcesRecorder
Recorder returns the recorder for registering API calls
func (*MockKnPingSourceClient) UpdatePingSource ¶
func (c *MockKnPingSourceClient) UpdatePingSource(ctx context.Context, pingSource *sourcesv1beta2.PingSource) error
UpdatePingSource performs a previously recorded action, failing if non has been registered
func (*MockKnPingSourceClient) UpdatePingSourceWithRetry ¶ added in v0.26.0
func (c *MockKnPingSourceClient) UpdatePingSourceWithRetry(ctx context.Context, name string, updateFunc PingSourceUpdateFunc, nrRetries int) error
type PingSourceBuilder ¶
type PingSourceBuilder struct {
// contains filtered or unexported fields
}
func NewPingSourceBuilder ¶
func NewPingSourceBuilder(name string) *PingSourceBuilder
func NewPingSourceBuilderFromExisting ¶
func NewPingSourceBuilderFromExisting(pingsource *sourcesv1beta2.PingSource) *PingSourceBuilder
func (*PingSourceBuilder) Build ¶
func (b *PingSourceBuilder) Build() *sourcesv1beta2.PingSource
func (*PingSourceBuilder) CloudEventOverrides ¶
func (b *PingSourceBuilder) CloudEventOverrides(ceo map[string]string, toRemove []string) *PingSourceBuilder
CloudEventOverrides adds given Cloud Event override extensions map to source spec
func (*PingSourceBuilder) Data ¶
func (b *PingSourceBuilder) Data(data string) *PingSourceBuilder
func (*PingSourceBuilder) DataBase64 ¶ added in v0.25.0
func (b *PingSourceBuilder) DataBase64(data string) *PingSourceBuilder
func (*PingSourceBuilder) Schedule ¶
func (b *PingSourceBuilder) Schedule(schedule string) *PingSourceBuilder
func (*PingSourceBuilder) Sink ¶
func (b *PingSourceBuilder) Sink(sink duckv1.Destination) *PingSourceBuilder
type PingSourceUpdateFunc ¶ added in v0.26.0
type PingSourceUpdateFunc func(origSource *sourcesv1beta2.PingSource) (*sourcesv1beta2.PingSource, error)
type PingSourcesRecorder ¶
type PingSourcesRecorder struct {
// contains filtered or unexported fields
}
recorder for service
func (*PingSourcesRecorder) CreatePingSource ¶
func (sr *PingSourcesRecorder) CreatePingSource(pingSource interface{}, err error)
CreatePingSource records a call for CreatePingSource with the expected error
func (*PingSourcesRecorder) DeletePingSource ¶
func (sr *PingSourcesRecorder) DeletePingSource(name interface{}, err error)
UpdatePingSource records a call for DeletePingSource with the expected error (nil if none)
func (*PingSourcesRecorder) GetPingSource ¶
func (sr *PingSourcesRecorder) GetPingSource(name interface{}, pingSource *sourcesv1beta2.PingSource, err error)
GetPingSource records a call for GetPingSource with the expected object or error. Either pingsource or err should be nil
func (*PingSourcesRecorder) ListPingSource ¶
func (sr *PingSourcesRecorder) ListPingSource(pingSourceList *sourcesv1beta2.PingSourceList, err error)
ListPingSource records a call for ListPingSource with the expected error (nil if none)
func (*PingSourcesRecorder) UpdatePingSource ¶
func (sr *PingSourcesRecorder) UpdatePingSource(pingSource interface{}, err error)
UpdatePingSource records a call for UpdatePingSource with the expected error (nil if none)
func (*PingSourcesRecorder) Validate ¶
func (sr *PingSourcesRecorder) Validate()
Validates validates whether every recorded action has been called