Documentation

Overview

Package v1alpha1 contains API Schema definitions for the eventing v1alpha1 API group +k8s:openapi-gen=true +k8s:deepcopy-gen=package,register +k8s:conversion-gen=github.com/google/knative-gcp/pkg/apis/pubsub +k8s:defaulter-gen=TypeMeta +groupName=pubsub.cloud.google.com

Index

Constants

const (
	// PullSubscriptionConditionReady has status True when the PullSubscription is
	// ready to send events.
	PullSubscriptionConditionReady = apis.ConditionReady

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

	// PullSubscriptionConditionDeployed has status True when the PullSubscription has
	// had its data plane resource(s) created.
	PullSubscriptionConditionDeployed apis.ConditionType = "Deployed"

	// PullSubscriptionConditionSubscribed has status True when a Google Cloud
	// Pub/Sub Subscription has been created pointing at the created receive
	// adapter deployment.
	PullSubscriptionConditionSubscribed apis.ConditionType = "Subscribed"

	// PullSubscriptionConditionTransformerProvided has status True when the
	// PullSubscription has been configured with a transformer target.
	PullSubscriptionConditionTransformerProvided apis.ConditionType = "TransformerProvided"
)

const (
	// TopicConditionReady has status True when all subconditions below have
	// been set to True.
	TopicConditionReady = apis.ConditionReady

	// TopicConditionAddressable has status true when this Topic meets the
	// Addressable contract and has a non-empty hostname.
	TopicConditionAddressable apis.ConditionType = "Addressable"

	// TopicConditionTopicExists has status True when the Topic has had a
	// Pub/Sub topic created for it.
	TopicConditionTopicExists apis.ConditionType = "TopicExists"

	// TopicConditionPublisherReady has status True when the Topic has had
	// its publisher deployment created and ready.
	TopicConditionPublisherReady apis.ConditionType = "PublisherReady"
)

Variables

var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)

var SchemeGroupVersion = schema.GroupVersion{Group: pubsub.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects


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 ModeType

type ModeType string
const (
	// ModeCloudEventsBinary will use CloudEvents binary HTTP mode with
	// flattened Pub/Sub payload.
	ModeCloudEventsBinary ModeType = "CloudEventsBinary"

	// ModeCloudEventsStructured will use CloudEvents structured HTTP mode with
	// flattened Pub/Sub payload.
	ModeCloudEventsStructured ModeType = "CloudEventsStructured"

	// ModePushCompatible will use CloudEvents binary HTTP mode with expanded
	// Pub/Sub payload that matches how Cloud Pub/Sub delivers a push message.
	ModePushCompatible ModeType = "PushCompatible"
)

type PropagationPolicyType

type PropagationPolicyType string

PropagationPolicyType defines enum type for TopicPolicy

const (
	// TopicPolicyCreateDelete defines the Cloud Pub/Sub topic management
	// policy for creating topic (if not present), and deleting topic when the
	// Topic resource is deleted.
	TopicPolicyCreateDelete PropagationPolicyType = "CreateDelete"

	// TopicPolicyCreateNoDelete defines the Cloud Pub/Sub topic management
	// policy for creating topic (if not present), and not deleting topic when
	// the Topic resource is deleted.
	TopicPolicyCreateNoDelete PropagationPolicyType = "CreateNoDelete"

	// TopicPolicyNoCreateNoDelete defines the Cloud Pub/Sub topic
	// management policy for only using existing topics, and not deleting
	// topic when the Topic resource is deleted.
	TopicPolicyNoCreateNoDelete PropagationPolicyType = "NoCreateNoDelete"
)

type PullSubscription

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

	Spec   PullSubscriptionSpec   `json:"spec,omitempty"`
	Status PullSubscriptionStatus `json:"status,omitempty"`
}

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

func (*PullSubscription) CheckImmutableFields

func (current *PullSubscription) CheckImmutableFields(ctx context.Context, original *PullSubscription) *apis.FieldError

func (*PullSubscription) ConditionSet

func (*PullSubscription) ConditionSet() *apis.ConditionSet

ConditionSet returns the apis.ConditionSet of the embedding object

func (*PullSubscription) ConvertFrom

func (sink *PullSubscription) ConvertFrom(_ context.Context, from apis.Convertible) error

ConvertFrom implements apis.Convertible. Converts obj from v1alpha1.PullSubscription into v1beta1.PullSubscription.

func (*PullSubscription) ConvertTo

func (source *PullSubscription) ConvertTo(_ context.Context, to apis.Convertible) error

ConvertTo implements apis.Convertible. Converts source (from v1beta1.PullSubscription) into v1alpha1.PullSubscription.

func (*PullSubscription) DeepCopy

func (in *PullSubscription) DeepCopy() *PullSubscription

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

func (*PullSubscription) DeepCopyInto

func (in *PullSubscription) DeepCopyInto(out *PullSubscription)

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

func (*PullSubscription) DeepCopyObject

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

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

func (*PullSubscription) GetGroupVersion

func (s *PullSubscription) GetGroupVersion() schema.GroupVersion

GetGroupVersionKind returns the GroupVersion.

func (*PullSubscription) GetGroupVersionKind

func (s *PullSubscription) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind returns the GroupVersionKind.

func (*PullSubscription) IdentitySpec

func (s *PullSubscription) IdentitySpec() *v1alpha1.IdentitySpec

Methods for identifiable interface. IdentitySpec returns the IdentitySpec portion of the Spec.

func (*PullSubscription) IdentityStatus

func (s *PullSubscription) IdentityStatus() *v1alpha1.IdentityStatus

IdentityStatus returns the IdentityStatus portion of the Status.

func (*PullSubscription) PubSubMode

func (p *PullSubscription) PubSubMode() ModeType

PubSubMode returns the mode currently set for PullSubscription.

func (*PullSubscription) SetDefaults

func (s *PullSubscription) SetDefaults(ctx context.Context)

func (*PullSubscription) Validate

func (current *PullSubscription) Validate(ctx context.Context) *apis.FieldError

type PullSubscriptionList

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

PullSubscriptionList contains a list of PubSubs.

func (*PullSubscriptionList) DeepCopy

func (in *PullSubscriptionList) DeepCopy() *PullSubscriptionList

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

func (*PullSubscriptionList) DeepCopyInto

func (in *PullSubscriptionList) DeepCopyInto(out *PullSubscriptionList)

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

func (*PullSubscriptionList) DeepCopyObject

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

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

type PullSubscriptionSpec

type PullSubscriptionSpec struct {
	v1alpha1.PubSubSpec `json:",inline"`

	// Topic is the ID of the PullSubscription Topic to Subscribe to. It must
	// be in the form of the unique identifier within the project, not the
	// entire name. E.g. it must be 'laconia', not
	// 'projects/my-proj/topics/laconia'.
	Topic string `json:"topic,omitempty"`

	// AckDeadline is the default maximum time after a subscriber receives a
	// message before the subscriber should acknowledge the message. Defaults
	// to 30 seconds ('30s').
	// +optional
	AckDeadline *string `json:"ackDeadline,omitempty"`

	// RetainAckedMessages defines whether to retain acknowledged messages. If
	// true, acknowledged messages will not be expunged until they fall out of
	// the RetentionDuration window.
	RetainAckedMessages bool `json:"retainAckedMessages,omitempty"`

	// RetentionDuration defines how long to retain messages in backlog, from
	// the time of publish. If RetainAckedMessages is true, this duration
	// affects the retention of acknowledged messages, otherwise only
	// unacknowledged messages are retained. Cannot be longer than 7 days or
	// shorter than 10 minutes. Defaults to 7 days ('7d').
	// +optional
	RetentionDuration *string `json:"retentionDuration,omitempty"`

	// Transformer is a reference to an object that will resolve to a domain
	// name or a URI directly to use as the transformer or a URI directly.
	// +optional
	Transformer *duckv1.Destination `json:"transformer,omitempty"`

	// Mode defines the encoding and structure of the payload of when the
	// PullSubscription invokes the sink.
	// +optional
	Mode ModeType `json:"mode,omitempty"`

	// AdapterType determines the type of receive adapter that a
	// PullSubscription uses.
	// +optional
	AdapterType string `json:"adapterType,omitempty"`
}

PullSubscriptionSpec defines the desired state of the PullSubscription.

func (*PullSubscriptionSpec) DeepCopy

func (in *PullSubscriptionSpec) DeepCopy() *PullSubscriptionSpec

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

func (*PullSubscriptionSpec) DeepCopyInto

func (in *PullSubscriptionSpec) DeepCopyInto(out *PullSubscriptionSpec)

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

func (PullSubscriptionSpec) GetAckDeadline

func (ps PullSubscriptionSpec) GetAckDeadline() time.Duration

GetAckDeadline parses AckDeadline and returns the default if an error occurs.

func (PullSubscriptionSpec) GetRetentionDuration

func (ps PullSubscriptionSpec) GetRetentionDuration() time.Duration

GetRetentionDuration parses RetentionDuration and returns the default if an error occurs.

func (*PullSubscriptionSpec) SetDefaults

func (ss *PullSubscriptionSpec) SetDefaults(ctx context.Context)

func (*PullSubscriptionSpec) Validate

func (current *PullSubscriptionSpec) Validate(ctx context.Context) *apis.FieldError

type PullSubscriptionStatus

type PullSubscriptionStatus struct {
	v1alpha1.PubSubStatus `json:",inline"`

	// TransformerURI is the current active transformer URI that has been
	// configured for the PullSubscription.
	// +optional
	TransformerURI *apis.URL `json:"transformerUri,omitempty"`

	// SubscriptionID is the created subscription ID used by the PullSubscription.
	// +optional
	SubscriptionID string `json:"subscriptionId,omitempty"`
}

PullSubscriptionStatus defines the observed state of PullSubscription.

func (*PullSubscriptionStatus) DeepCopy

func (in *PullSubscriptionStatus) DeepCopy() *PullSubscriptionStatus

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

func (*PullSubscriptionStatus) DeepCopyInto

func (in *PullSubscriptionStatus) DeepCopyInto(out *PullSubscriptionStatus)

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

func (*PullSubscriptionStatus) GetCondition

func (s *PullSubscriptionStatus) GetCondition(t apis.ConditionType) *apis.Condition

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

func (*PullSubscriptionStatus) GetTopLevelCondition

func (s *PullSubscriptionStatus) GetTopLevelCondition() *apis.Condition

GetTopLevelCondition returns the top level Condition.

func (*PullSubscriptionStatus) InitializeConditions

func (s *PullSubscriptionStatus) InitializeConditions()

InitializeConditions sets relevant unset conditions to Unknown state.

func (*PullSubscriptionStatus) IsReady

func (s *PullSubscriptionStatus) IsReady() bool

IsReady returns true if the resource is ready overall.

func (*PullSubscriptionStatus) MarkDeployed

func (s *PullSubscriptionStatus) MarkDeployed()

MarkDeployed sets the condition that the source has been deployed.

func (*PullSubscriptionStatus) MarkDeprecated

func (s *PullSubscriptionStatus) MarkDeprecated()

MarkDeprecated adds a warning condition that this object is deprecated and will be dropped in a future release. Note that this does not affect the Ready condition.

func (*PullSubscriptionStatus) MarkNoSink

func (s *PullSubscriptionStatus) MarkNoSink(reason, messageFormat string, messageA ...interface{})

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

func (*PullSubscriptionStatus) MarkNoSubscription

func (s *PullSubscriptionStatus) MarkNoSubscription(reason, messageFormat string, messageA ...interface{})

MarkNoSubscription sets the condition that the subscription does not exist.

func (*PullSubscriptionStatus) MarkNoTransformer

func (s *PullSubscriptionStatus) MarkNoTransformer(reason, messageFormat string, messageA ...interface{})

MarkNoTransformer sets the condition that the source does not have a transformer configured.

func (*PullSubscriptionStatus) MarkNotDeployed

func (s *PullSubscriptionStatus) MarkNotDeployed(reason, messageFormat string, messageA ...interface{})

MarkNotDeployed sets the condition that the source has not been deployed.

func (*PullSubscriptionStatus) MarkSink

func (s *PullSubscriptionStatus) MarkSink(uri *apis.URL)

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

func (*PullSubscriptionStatus) MarkSubscribed

func (s *PullSubscriptionStatus) MarkSubscribed(subscriptionID string)

MarkSubscribed sets the condition that the subscription has been created.

func (*PullSubscriptionStatus) MarkTransformer

func (s *PullSubscriptionStatus) MarkTransformer(uri *apis.URL)

MarkTransformer sets the condition that the source has a transformer configured.

type Topic

type Topic struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the desired state of the Topic.
	Spec TopicSpec `json:"spec,omitempty"`

	// Status represents the current state of the Topic. This data may be out of
	// date.
	// +optional
	Status TopicStatus `json:"status,omitempty"`
}

Topic is a resource representing a Topic backed by Google Cloud Pub/Sub.

func (*Topic) CheckImmutableFields

func (current *Topic) CheckImmutableFields(ctx context.Context, original *Topic) *apis.FieldError

func (*Topic) ConditionSet

func (ps *Topic) ConditionSet() *apis.ConditionSet

ConditionSet returns the apis.ConditionSet of the embedding object

func (*Topic) ConvertFrom

func (sink *Topic) ConvertFrom(ctx context.Context, from apis.Convertible) error

ConvertFrom implements apis.Convertible. Converts obj from v1alpha1.PullSubscription into v1beta1.PullSubscription.

func (*Topic) ConvertTo

func (source *Topic) ConvertTo(ctx context.Context, to apis.Convertible) error

ConvertTo implements apis.Convertible. Converts source (from v1beta1.PullSubscription) into v1alpha1.PullSubscription.

func (*Topic) DeepCopy

func (in *Topic) DeepCopy() *Topic

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

func (*Topic) DeepCopyInto

func (in *Topic) DeepCopyInto(out *Topic)

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

func (*Topic) DeepCopyObject

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

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

func (*Topic) GetGroupVersionKind

func (t *Topic) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind returns GroupVersionKind for Pub/Sub backed Topic.

func (*Topic) IdentitySpec

func (s *Topic) IdentitySpec() *v1alpha1.IdentitySpec

Methods for identifiable interface. IdentitySpec returns the IdentitySpec portion of the Spec.

func (*Topic) IdentityStatus

func (s *Topic) IdentityStatus() *v1alpha1.IdentityStatus

IdentityStatus returns the IdentityStatus portion of the Status.

func (*Topic) SetDefaults

func (t *Topic) SetDefaults(ctx context.Context)

func (*Topic) Validate

func (t *Topic) Validate(ctx context.Context) *apis.FieldError

type TopicList

type TopicList struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Topic `json:"items"`
}

TopicList is a collection of Pub/Sub backed Topics.

func (*TopicList) DeepCopy

func (in *TopicList) DeepCopy() *TopicList

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

func (*TopicList) DeepCopyInto

func (in *TopicList) DeepCopyInto(out *TopicList)

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

func (*TopicList) DeepCopyObject

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

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

type TopicSpec

type TopicSpec struct {
	v1alpha1.IdentitySpec `json:",inline"`

	// Secret is the credential to be used to create and publish into the
	// Cloud Pub/Sub Topic. The value of the secret entry must be a service
	// account key in the JSON format
	// (see https://cloud.google.com/iam/docs/creating-managing-service-account-keys).
	Secret *corev1.SecretKeySelector `json:"secret,omitempty"`

	// Project is the ID of the Google Cloud Project that the Pub/Sub
	// Topic will be created in or used from.
	Project string `json:"project,omitempty"`

	// Topic is the ID of the Topic to create/use in Google Cloud Pub/Sub.
	Topic string `json:"topic,omitempty"`

	//PropagationPolicy defines how Topic controls the Cloud Pub/Sub topic for
	// lifecycle changes. Defaults to TopicPolicyCreateNoDelete if empty.
	PropagationPolicy PropagationPolicyType `json:"propagationPolicy,omitempty"`
}

TopicSpec defines parameters for creating or publishing to a Cloud Pub/Sub Topic depending on the PropagationPolicy.

func (*TopicSpec) DeepCopy

func (in *TopicSpec) DeepCopy() *TopicSpec

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

func (*TopicSpec) DeepCopyInto

func (in *TopicSpec) DeepCopyInto(out *TopicSpec)

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

func (*TopicSpec) SetDefaults

func (ts *TopicSpec) SetDefaults(ctx context.Context)

func (*TopicSpec) Validate

func (ts *TopicSpec) Validate(ctx context.Context) *apis.FieldError

type TopicStatus

type TopicStatus struct {
	v1alpha1.IdentityStatus `json:",inline"`

	// Topic is Addressable. It currently exposes the endpoint as a
	// fully-qualified DNS name which will distribute traffic over the
	// provided targets from inside the cluster.
	//
	// It generally has the form {Topic}.{namespace}.svc.{cluster domain name}
	duckv1alpha1.AddressStatus `json:",inline"`

	// ProjectID is the resolved project ID in use by the Topic.
	// +optional
	ProjectID string `json:"projectId,omitempty"`

	// TopicID is the created topic ID used by the Topic.
	// +optional
	TopicID string `json:"topicId,omitempty"`
}

TopicStatus represents the current state of a Topic.

func (*TopicStatus) DeepCopy

func (in *TopicStatus) DeepCopy() *TopicStatus

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

func (*TopicStatus) DeepCopyInto

func (in *TopicStatus) DeepCopyInto(out *TopicStatus)

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

func (*TopicStatus) GetCondition

func (ts *TopicStatus) GetCondition(t apis.ConditionType) *apis.Condition

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

func (*TopicStatus) GetTopLevelCondition

func (ts *TopicStatus) GetTopLevelCondition() *apis.Condition

GetTopLevelCondition returns the top level condition

func (*TopicStatus) InitializeConditions

func (ts *TopicStatus) InitializeConditions()

InitializeConditions sets relevant unset conditions to Unknown state.

func (*TopicStatus) IsReady

func (ts *TopicStatus) IsReady() bool

IsReady returns true if the resource is ready overall.

func (*TopicStatus) MarkDeprecated

func (ts *TopicStatus) MarkDeprecated()

MarkDeprecated adds a warning condition that this object is deprecated and will be dropped in a future release. Note that this does not affect the Ready condition.

func (*TopicStatus) MarkNoTopic

func (ts *TopicStatus) MarkNoTopic(reason, messageFormat string, messageA ...interface{})

MarkNoTopic sets the condition that signals there is not a topic for this Topic. This could be because of an error or the Topic is being deleted.

func (*TopicStatus) MarkPublisherDeployed

func (ts *TopicStatus) MarkPublisherDeployed()

MarkPublisherDeployed sets the condition that the publisher has been deployed.

func (*TopicStatus) MarkPublisherNotConfigured

func (ts *TopicStatus) MarkPublisherNotConfigured()

MarkPublisherNotConfigured changes the PublisherReady condition to be unknown to reflect that the Publisher does not yet have a Status.

func (*TopicStatus) MarkPublisherNotDeployed

func (ts *TopicStatus) MarkPublisherNotDeployed(reason, messageFormat string, messageA ...interface{})

MarkPublisherNotDeployed sets the condition that the publisher has not been deployed.

func (*TopicStatus) MarkPublisherUnknown

func (ts *TopicStatus) MarkPublisherUnknown(reason, messageFormat string, messageA ...interface{})

MarkPublisherUnknown sets the condition that the status of publisher is Unknown.

func (*TopicStatus) MarkTopicReady

func (ts *TopicStatus) MarkTopicReady()

MarkTopicReady sets the condition that the topic has been created.

func (*TopicStatus) PropagatePublisherStatus

func (ts *TopicStatus) PropagatePublisherStatus(ss *v1.ServiceStatus)

func (*TopicStatus) SetAddress

func (ts *TopicStatus) SetAddress(url *apis.URL)

TODO: Use the new beta duck types.