v1

package
v0.0.0-...-441372a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServerSourceBuilder

type APIServerSourceBuilder struct {
	// contains filtered or unexported fields
}

APIServerSourceBuilder is for building the source

func NewAPIServerSourceBuilder

func NewAPIServerSourceBuilder(name string) *APIServerSourceBuilder

NewAPIServerSourceBuilder for building ApiServer source object

func NewAPIServerSourceBuilderFromExisting

func NewAPIServerSourceBuilderFromExisting(apiServerSource *v1.ApiServerSource) *APIServerSourceBuilder

NewAPIServerSourceBuilderFromExisting for building the object from existing ApiServerSource object

func (*APIServerSourceBuilder) Build

Build the ApiServerSource object

func (*APIServerSourceBuilder) CloudEventOverrides

func (b *APIServerSourceBuilder) CloudEventOverrides(ceo map[string]string, toRemove []string) *APIServerSourceBuilder

CloudEventOverrides adds given Cloud Event override extensions map to source spec

func (*APIServerSourceBuilder) EventMode

func (b *APIServerSourceBuilder) EventMode(eventMode string) *APIServerSourceBuilder

EventMode for whether to send resource 'Ref' or complete 'Resource'

func (*APIServerSourceBuilder) Resources

Resources which should be streamed

func (*APIServerSourceBuilder) ServiceAccount

func (b *APIServerSourceBuilder) ServiceAccount(sa string) *APIServerSourceBuilder

ServiceAccount with which this source should operate

func (*APIServerSourceBuilder) Sink

Sink or destination of the source

type APIServerSourcesRecorder

type APIServerSourcesRecorder struct {
	// contains filtered or unexported fields
}

APIServerSourcesRecorder for recording actions on source

func (*APIServerSourcesRecorder) CreateAPIServerSource

func (sr *APIServerSourcesRecorder) CreateAPIServerSource(apiServerSource interface{}, err error)

CreateAPIServerSource records a call for CreateApiServerSource with the expected error

func (*APIServerSourcesRecorder) DeleteAPIServerSource

func (sr *APIServerSourcesRecorder) DeleteAPIServerSource(name interface{}, err error)

DeleteAPIServerSource records a call for DeleteAPIServerSource with the expected error (nil if none)

func (*APIServerSourcesRecorder) GetAPIServerSource

func (sr *APIServerSourcesRecorder) GetAPIServerSource(name interface{}, apiServerSource *v1.ApiServerSource, err error)

GetAPIServerSource records a call for GetApiServerSource with the expected object or error. Either apiServerSource or err should be nil

func (*APIServerSourcesRecorder) ListAPIServerSource

func (sr *APIServerSourcesRecorder) ListAPIServerSource(apiJobSourceList *v1.ApiServerSourceList, err error)

ListAPIServerSource records a call for ListAPIServerSource with the expected error (nil if none)

func (*APIServerSourcesRecorder) UpdateAPIServerSource

func (sr *APIServerSourcesRecorder) UpdateAPIServerSource(apiServerSource interface{}, err error)

UpdateAPIServerSource records a call for UpdateAPIServerSource with the expected error (nil if none)

func (*APIServerSourcesRecorder) Validate

func (sr *APIServerSourcesRecorder) Validate()

Validate validates whether every recorded action has been called

type ConainterSourceRecorder

type ConainterSourceRecorder struct {
	// contains filtered or unexported fields
}

ConainterSourceRecorder is recorder for eventing objects

func (*ConainterSourceRecorder) CreateContainerSource

func (sr *ConainterSourceRecorder) CreateContainerSource(binding interface{}, err error)

CreateContainerSource records a call for CreateContainerSource with the expected error

func (*ConainterSourceRecorder) DeleteContainerSource

func (sr *ConainterSourceRecorder) DeleteContainerSource(name interface{}, err error)

DeleteContainerSource records a call for DeleteContainerSource with the expected error (nil if none)

func (*ConainterSourceRecorder) GetContainerSource

func (sr *ConainterSourceRecorder) GetContainerSource(name interface{}, binding *v1.ContainerSource, err error)

GetContainerSource records a call for GetContainerSource with the expected object or error. Either binding or err should be nil

func (*ConainterSourceRecorder) ListContainerSources

func (sr *ConainterSourceRecorder) ListContainerSources(bindingList *v1.ContainerSourceList, err error)

ListContainerSources records a call for ListContainerSources with the expected result and error (nil if none)

func (*ConainterSourceRecorder) UpdateContainerSource

func (sr *ConainterSourceRecorder) UpdateContainerSource(binding interface{}, err error)

UpdateContainerSource records a call for ListContainerSources with the expected result and error (nil if none)

func (*ConainterSourceRecorder) Validate

func (sr *ConainterSourceRecorder) Validate()

Validate validates whether every recorded action has been called

type ContainerSourceBuilder

type ContainerSourceBuilder struct {
	ContainerSource *v1.ContainerSource
}

ContainerSourceBuilder is for building the source

func NewContainerSourceBuilder

func NewContainerSourceBuilder(name string) *ContainerSourceBuilder

NewContainerSourceBuilder for building Container source object

func NewContainerSourceBuilderFromExisting

func NewContainerSourceBuilderFromExisting(ContainerSource *v1.ContainerSource) *ContainerSourceBuilder

NewContainerSourceBuilderFromExisting for building the object from existing ContainerSource object

func (*ContainerSourceBuilder) Build

Build the ContainerSource object

func (*ContainerSourceBuilder) PodSpec

PodSpec defines the PodSpec

func (*ContainerSourceBuilder) Sink

Sink or destination of the source

type ContainerUpdateFunc

type ContainerUpdateFunc func(source *v1.ContainerSource) (*v1.ContainerSource, error)

type EventingRecorder

type EventingRecorder struct {
	// contains filtered or unexported fields
}

EventingRecorder is recorder for eventing objects

func (*EventingRecorder) CreateSinkBinding

func (sr *EventingRecorder) CreateSinkBinding(binding interface{}, err error)

CreateSinkBinding records a call for CreateSinkBinding with the expected error

func (*EventingRecorder) DeleteSinkBinding

func (sr *EventingRecorder) DeleteSinkBinding(name interface{}, err error)

DeleteSinkBinding records a call for DeleteSinkBinding with the expected error (nil if none)

func (*EventingRecorder) GetSinkBinding

func (sr *EventingRecorder) GetSinkBinding(name interface{}, binding *v1.SinkBinding, err error)

GetSinkBinding records a call for GetSinkBinding with the expected object or error. Either binding or err should be nil

func (*EventingRecorder) ListSinkBindings

func (sr *EventingRecorder) ListSinkBindings(bindingList *v1.SinkBindingList, err error)

ListSinkBindings records a call for ListSinkBindings with the expected result and error (nil if none)

func (*EventingRecorder) UpdateSinkBinding

func (sr *EventingRecorder) UpdateSinkBinding(binding interface{}, err error)

UpdateSinkBinding records a call for ListSinkBindings 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 KnAPIServerSourcesClient

type KnAPIServerSourcesClient interface {

	// Get an ApiServerSource by name
	GetAPIServerSource(ctx context.Context, name string) (*v1.ApiServerSource, error)

	// Create an ApiServerSource by object
	CreateAPIServerSource(ctx context.Context, apiSource *v1.ApiServerSource) error

	// Update an ApiServerSource by object
	UpdateAPIServerSource(ctx context.Context, apiSource *v1.ApiServerSource) error

	// Delete an ApiServerSource by name
	DeleteAPIServerSource(ctx context.Context, name string) error

	// List ApiServerSource
	// TODO: Support list configs like in service list
	ListAPIServerSource(ctx context.Context) (*v1.ApiServerSourceList, error)

	// Get namespace for this client
	Namespace() string
}

KnAPIServerSourcesClient interface for working with ApiServer sources

type KnContainerSourcesClient

type KnContainerSourcesClient interface {

	// Get an ContainerSource by name
	GetContainerSource(ctx context.Context, name string) (*v1.ContainerSource, error)

	// Create an ContainerSource by object
	CreateContainerSource(ctx context.Context, containerSrc *v1.ContainerSource) error

	// Update an ContainerSource by object
	UpdateContainerSource(ctx context.Context, containerSrc *v1.ContainerSource) error

	// Update an ContainerSource by object and retry on conflict
	UpdateContainerSourceWithRetry(ctx context.Context, name string, updateFunc ContainerUpdateFunc, nrRetries int) error

	// Delete an ContainerSource by name
	DeleteContainerSource(name string, ctx context.Context) error

	// List ContainerSource
	ListContainerSources(ctx context.Context) (*v1.ContainerSourceList, error)

	// Get namespace for this client
	Namespace() string
}

KnContainerSourcesClient interface for working with ApiServer sources

type KnSinkBindingClient

type KnSinkBindingClient interface {
	// Namespace in which this client is operating for
	Namespace() string
	// CreateSinkBinding is used to create an instance of binding
	CreateSinkBinding(ctx context.Context, binding *v1.SinkBinding) error
	// DeleteSinkBinding is used to delete an instance of binding
	DeleteSinkBinding(ctx context.Context, name string) error
	// GetSinkBinding is used to get an instance of binding
	GetSinkBinding(ctx context.Context, name string) (*v1.SinkBinding, error)
	// ListSinkBinding returns list of binding CRDs
	ListSinkBindings(ctx context.Context) (*v1.SinkBindingList, error)
	// UpdateSinkBinding is used to update an instance of binding
	UpdateSinkBinding(ctx context.Context, binding *v1.SinkBinding) error
}

KnSinkBindingClient to Eventing Sources. All methods are relative to the namespace specified during construction

type KnSourcesClient

type KnSourcesClient interface {
	// Get client for sink binding sources
	SinkBindingClient() KnSinkBindingClient

	// Get client for ApiServer sources
	APIServerSourcesClient() KnAPIServerSourcesClient

	// Get client for container sources
	ContainerSourcesClient() KnContainerSourcesClient
}

KnSinkBindingClient to Eventing Sources. All methods are relative to the namespace specified during construction

func NewKnSourcesClient

func NewKnSourcesClient(client clientv1.SourcesV1Interface, namespace string) KnSourcesClient

NewKnSourcesClient for managing all eventing built-in sources

type MockKnAPIServerSourceClient

type MockKnAPIServerSourceClient struct {
	// contains filtered or unexported fields
}

MockKnAPIServerSourceClient for mocking the client

func NewMockKnAPIServerSourceClient

func NewMockKnAPIServerSourceClient(t *testing.T, ns ...string) *MockKnAPIServerSourceClient

NewMockKnAPIServerSourceClient returns a new mock instance which you need to record for

func (*MockKnAPIServerSourceClient) CreateAPIServerSource

func (c *MockKnAPIServerSourceClient) CreateAPIServerSource(ctx context.Context, apiServerSource *v1.ApiServerSource) error

CreateAPIServerSource performs a previously recorded action, failing if non has been registered

func (*MockKnAPIServerSourceClient) DeleteAPIServerSource

func (c *MockKnAPIServerSourceClient) DeleteAPIServerSource(ctx context.Context, name string) error

DeleteAPIServerSource performs a previously recorded action, failing if non has been registered

func (*MockKnAPIServerSourceClient) GetAPIServerSource

func (c *MockKnAPIServerSourceClient) GetAPIServerSource(ctx context.Context, name string) (*v1.ApiServerSource, error)

GetAPIServerSource performs a previously recorded action, failing if non has been registered

func (*MockKnAPIServerSourceClient) ListAPIServerSource

ListAPIServerSource performs a previously recorded action, failing if non has been registered

func (*MockKnAPIServerSourceClient) Namespace

func (c *MockKnAPIServerSourceClient) Namespace() string

Namespace of this client

func (*MockKnAPIServerSourceClient) Recorder

Recorder returns the recorder for registering API calls

func (*MockKnAPIServerSourceClient) UpdateAPIServerSource

func (c *MockKnAPIServerSourceClient) UpdateAPIServerSource(ctx context.Context, apiServerSource *v1.ApiServerSource) error

UpdateAPIServerSource performs a previously recorded action, failing if non has been registered

type MockKnContainerSourceClient

type MockKnContainerSourceClient struct {
	// contains filtered or unexported fields
}

MockKnContainerSourceClient is a combine of test object and recorder

func NewMockKnContainerSourceClient

func NewMockKnContainerSourceClient(t *testing.T, ns ...string) *MockKnContainerSourceClient

NewMockKnContainerSourceClient returns a new mock instance which you need to record for

func (*MockKnContainerSourceClient) CreateContainerSource

func (c *MockKnContainerSourceClient) CreateContainerSource(ctx context.Context, binding *v1.ContainerSource) error

CreateContainerSource performs a previously recorded action

func (*MockKnContainerSourceClient) DeleteContainerSource

func (c *MockKnContainerSourceClient) DeleteContainerSource(name string, ctx context.Context) error

DeleteContainerSource performs a previously recorded action, failing if non has been registered

func (*MockKnContainerSourceClient) GetContainerSource

func (c *MockKnContainerSourceClient) GetContainerSource(ctx context.Context, name string) (*v1.ContainerSource, error)

GetContainerSource performs a previously recorded action

func (*MockKnContainerSourceClient) ListContainerSources

ListContainerSources performs a previously recorded action

func (*MockKnContainerSourceClient) Namespace

func (c *MockKnContainerSourceClient) Namespace() string

Namespace of this client

func (*MockKnContainerSourceClient) Recorder

Recorder returns the recorder for registering API calls

func (*MockKnContainerSourceClient) UpdateContainerSource

func (c *MockKnContainerSourceClient) UpdateContainerSource(ctx context.Context, containerSrc *v1.ContainerSource) error

UpdateContainerSource performs a previously recorded action

func (*MockKnContainerSourceClient) UpdateContainerSourceWithRetry

func (c *MockKnContainerSourceClient) UpdateContainerSourceWithRetry(ctx context.Context, name string, updateFunc ContainerUpdateFunc, nrRetries int) error

type MockKnSinkBindingClient

type MockKnSinkBindingClient struct {
	// contains filtered or unexported fields
}

MockKnSinkBindingClient is a combine of test object and recorder

func NewMockKnSinkBindingClient

func NewMockKnSinkBindingClient(t *testing.T, ns ...string) *MockKnSinkBindingClient

NewMockKnSinkBindingClient returns a new mock instance which you need to record for

func (*MockKnSinkBindingClient) CreateSinkBinding

func (c *MockKnSinkBindingClient) CreateSinkBinding(ctx context.Context, binding *v1.SinkBinding) error

CreateSinkBinding performs a previously recorded action

func (*MockKnSinkBindingClient) DeleteSinkBinding

func (c *MockKnSinkBindingClient) DeleteSinkBinding(ctx context.Context, name string) error

DeleteSinkBinding performs a previously recorded action, failing if non has been registered

func (*MockKnSinkBindingClient) GetSinkBinding

func (c *MockKnSinkBindingClient) GetSinkBinding(ctx context.Context, name string) (*v1.SinkBinding, error)

GetSinkBinding performs a previously recorded action

func (*MockKnSinkBindingClient) ListSinkBindings

ListSinkBindings performs a previously recorded action

func (*MockKnSinkBindingClient) Namespace

func (c *MockKnSinkBindingClient) Namespace() string

Namespace of this client

func (*MockKnSinkBindingClient) Recorder

Recorder returns the recorder for registering API calls

func (*MockKnSinkBindingClient) UpdateSinkBinding

func (c *MockKnSinkBindingClient) UpdateSinkBinding(ctx context.Context, binding *v1.SinkBinding) error

UpdateSinkBinding performs a previously recorded action

type SinkBindingBuilder

type SinkBindingBuilder struct {
	// contains filtered or unexported fields
}

SinkBindingBuilder is for building the binding

func NewSinkBindingBuilder

func NewSinkBindingBuilder(name string) *SinkBindingBuilder

NewSinkBindingBuilder for building binding object

func NewSinkBindingBuilderFromExisting

func NewSinkBindingBuilderFromExisting(binding *v1.SinkBinding) *SinkBindingBuilder

NewSinkBindingBuilderFromExisting for building the object from existing SinkBinding object

func (*SinkBindingBuilder) AddSubjectMatchLabel

func (b *SinkBindingBuilder) AddSubjectMatchLabel(labelKey, labelValue string) *SinkBindingBuilder

Add a label match part for building up the subject

func (*SinkBindingBuilder) Build

func (b *SinkBindingBuilder) Build() (*v1.SinkBinding, error)

Build to return an instance of binding object

func (*SinkBindingBuilder) CloudEventOverrides

func (b *SinkBindingBuilder) CloudEventOverrides(ceo map[string]string, toRemove []string) *SinkBindingBuilder

CloudEventOverrides adds given Cloud Event override extensions map to source spec

func (*SinkBindingBuilder) Namespace

func (b *SinkBindingBuilder) Namespace(ns string) *SinkBindingBuilder

Namespace for this binding

func (*SinkBindingBuilder) Sink

Broker to set the broker of binding object

func (*SinkBindingBuilder) Subject

Subscriber for the binding to send to (it's a Sink actually)

func (*SinkBindingBuilder) SubjectGVK

Add a GVK of the subject

func (*SinkBindingBuilder) SubjectName

func (b *SinkBindingBuilder) SubjectName(name string) *SinkBindingBuilder

Add a subject name for building up the name

func (*SinkBindingBuilder) SubjectNamespace

func (b *SinkBindingBuilder) SubjectNamespace(ns string) *SinkBindingBuilder

Add a subject namespace for building up the name

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL