v1alpha1

package
v0.0.0-...-25e0b32 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the sources v1alpha1 API group +k8s:deepcopy-gen=package +groupName=sources.google.com

Index

Constants

View Source
const (
	// MongoDbConditionReady has status True when the MongoDbSource is ready to send events.
	MongoDbConditionReady = apis.ConditionReady

	// MongoDbConditionSinkProvided has status True when the MongoDbSource has been configured with a sink target.
	MongoDbConditionSinkProvided apis.ConditionType = "SinkProvided"

	// MongoDbConditionConnectionEstablished has status True when the MongoDbSource has correct credentials and
	// was able to successfully connect to the correct database or collection.
	MongoDbConditionConnectionEstablished apis.ConditionType = "ConnectionEstablished"

	// MongoDbConditionDeployed has status True when the MongoDbSource has had it's deployment created.
	MongoDbConditionDeployed apis.ConditionType = "Deployed"
)
View Source
const (
	// MongoDbSourceInsertedEventType is the MongoDbSource CloudEvent type for an insert.
	MongoDbSourceInsertedEventType = "google.com.mongodb.collection.v1.inserted"

	// MongoDbSourceDeletedEventType is the MongoDbSource CloudEvent type for a deletion.
	MongoDbSourceDeletedEventType = "google.com.mongodb.collection.v1.deleted"

	// MongoDbSourceUpdatedEventType is the MongoDbSource CloudEvent type for an update.
	MongoDbSourceUpdatedEventType = "google.com.mongodb.collection.v1.updated"
)

Variables

View Source
var (
	// SchemeGroupVersion is group version used to register these objects.
	SchemeGroupVersion = schema.GroupVersion{Group: sources.GroupName, Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	// AddToScheme is used to add go types to the GroupVersionKind scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

MongoDbCondSet holds NewLivingConditionSet.

View Source
var MongoDbSourceEventTypes = map[string]string{
	"insert":  MongoDbSourceInsertedEventType,
	"delete":  MongoDbSourceDeletedEventType,
	"replace": MongoDbSourceUpdatedEventType,
}

MongoDbSourceEventTypes are the different types of event the source produces.

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource.

Types

type MongoDbSource

type MongoDbSource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   MongoDbSourceSpec   `json:"spec"`
	Status MongoDbSourceStatus `json:"status,omitempty"`
}

MongoDbSource is the Schema for the MongoDbSource API. +k8s:openapi-gen=true

func (*MongoDbSource) DeepCopy

func (in *MongoDbSource) DeepCopy() *MongoDbSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MongoDbSource.

func (*MongoDbSource) DeepCopyInto

func (in *MongoDbSource) DeepCopyInto(out *MongoDbSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MongoDbSource) DeepCopyObject

func (in *MongoDbSource) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*MongoDbSource) GetConditionSet

func (*MongoDbSource) GetConditionSet() apis.ConditionSet

GetConditionSet retrieves the condition set for this resource. Implements the KRShaped interface.

func (*MongoDbSource) GetGroupVersionKind

func (m *MongoDbSource) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind returns the GroupVersionKind.

func (*MongoDbSource) GetStatus

func (m *MongoDbSource) GetStatus() *duckv1.Status

GetStatus retrieves the duck status for this resource. Implements the KRShaped interface.

func (*MongoDbSource) SetDefaults

func (m *MongoDbSource) SetDefaults(ctx context.Context)

SetDefaults mutates MongoDbSource.

func (*MongoDbSource) Validate

func (m *MongoDbSource) Validate(ctx context.Context) *apis.FieldError

Validate validates MongoDbSource.

type MongoDbSourceList

type MongoDbSourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []MongoDbSource `json:"items"`
}

MongoDbSourceList contains a list of MongoDbSource.

func (*MongoDbSourceList) DeepCopy

func (in *MongoDbSourceList) DeepCopy() *MongoDbSourceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MongoDbSourceList.

func (*MongoDbSourceList) DeepCopyInto

func (in *MongoDbSourceList) DeepCopyInto(out *MongoDbSourceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MongoDbSourceList) DeepCopyObject

func (in *MongoDbSourceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type MongoDbSourceSpec

type MongoDbSourceSpec struct {
	// ServiceAccountName holds the name of the Kubernetes service account
	// as which the underlying K8s resources should be run. If unspecified
	// this will default to the "default" service account for the namespace
	// in which the MongoDbSource exists.
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// MongoDbCredentials is the credential to use to access MongoDb.
	// Must be a secret. Only Name and Namespace are used.
	Secret corev1.LocalObjectReference `json:"secret"`

	// Database is the database to watch for changes.
	Database string `json:"database"`

	// Collection is the collection to watch for changes.
	// +optional
	Collection string `json:"collection,omitempty"`

	// SourceSpec
	// inherits duck/v1 SourceSpec, which currently provides:
	// * Sink - a reference to an object that will resolve to a domain name or
	//   a URI directly to use as the sink.
	// * CloudEventOverrides - defines overrides to control the output format
	//   and modifications of the event sent to the sink.
	duckv1.SourceSpec `json:",inline"`
}

MongoDbSourceSpec defines the desired state of MongoDbSource.

func (*MongoDbSourceSpec) DeepCopy

func (in *MongoDbSourceSpec) DeepCopy() *MongoDbSourceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MongoDbSourceSpec.

func (*MongoDbSourceSpec) DeepCopyInto

func (in *MongoDbSourceSpec) DeepCopyInto(out *MongoDbSourceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MongoDbSourceSpec) ValidateSpecs

func (ms *MongoDbSourceSpec) ValidateSpecs(ctx context.Context) *apis.FieldError

ValidateSpecs validates MongoDbSourceSpecs.

type MongoDbSourceStatus

type MongoDbSourceStatus struct {
	// inherits duck/v1 SourceStatus, which currently provides:
	// * ObservedGeneration - the 'Generation' of the Service that was last
	//   processed by the controller.
	// * Conditions - the latest available observations of a resource's current
	//   state.
	// * SinkURI - the current active sink URI that has been configured for the
	//   Source.
	duckv1.SourceStatus `json:",inline"`
}

MongoDbSourceStatus defines the observed state of MongoDbSource.

func (*MongoDbSourceStatus) DeepCopy

func (in *MongoDbSourceStatus) DeepCopy() *MongoDbSourceStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MongoDbSourceStatus.

func (*MongoDbSourceStatus) DeepCopyInto

func (in *MongoDbSourceStatus) DeepCopyInto(out *MongoDbSourceStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*MongoDbSourceStatus) GetCondition

func (m *MongoDbSourceStatus) GetCondition(t apis.ConditionType) *apis.Condition

GetCondition returns the condition currently associated with the given type, or nil.

func (*MongoDbSourceStatus) InitializeConditions

func (m *MongoDbSourceStatus) InitializeConditions()

InitializeConditions sets relevant unset conditions to Unknown state.

func (*MongoDbSourceStatus) IsReady

func (m *MongoDbSourceStatus) IsReady() bool

IsReady returns true if the resource is ready overall.

func (*MongoDbSourceStatus) MarkConnectionFailed

func (m *MongoDbSourceStatus) MarkConnectionFailed(err error)

MarkConnectionFailed sets the condition that the source has incorrect credentials or that the specified database or collection is not found.

func (*MongoDbSourceStatus) MarkConnectionSuccess

func (m *MongoDbSourceStatus) MarkConnectionSuccess()

MarkConnectionSuccess sets the condition that the source has correct credentials and that the specified database or collection is found.

func (*MongoDbSourceStatus) MarkNoSink

func (m *MongoDbSourceStatus) MarkNoSink(reason, messageFormat string, messageA ...interface{})

MarkNoSink sets the condition that the source does not have a sink configured.

func (*MongoDbSourceStatus) MarkSink

func (m *MongoDbSourceStatus) MarkSink(uri *apis.URL)

MarkSink sets the condition that the source has a sink configured.

func (*MongoDbSourceStatus) PropagateDeploymentAvailability

func (m *MongoDbSourceStatus) PropagateDeploymentAvailability(d *appsv1.Deployment)

PropagateDeploymentAvailability uses the availability of the provided Deployment to determine if MongoDbConditionDeployed should be marked as true or false.

Jump to

Keyboard shortcuts

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