v1alpha1

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

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.run

Index

Constants

View Source
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 receive adapter deployment 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"

	// PullSubscriptionConditionEventTypesProvided has status True when the
	// PullSubscription has been configured with event types.
	PullSubscriptionConditionEventTypesProvided apis.ConditionType = "EventTypesProvided"
)
View Source
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

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: pubsub.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func DefaultGoogleCloudSecretSelector added in v0.8.1

func DefaultGoogleCloudSecretSelector() *corev1.SecretKeySelector

DefaultGoogleCloudSecretSelector is the default secret selector used to load the creds for the objects that will auth with Google Cloud.

func Kind

func Kind(kind string) schema.GroupKind

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

func PubSubEventSource

func PubSubEventSource(googleCloudProject, topic string) string

PubSubEventSource returns the Cloud Pub/Sub CloudEvent source value.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type CloudEventOverrides added in v0.8.1

type CloudEventOverrides struct {
	// Extensions specify what attribute are added or overridden on the
	// outbound event. Each `Extensions` key-value pair are set on the event as
	// an attribute extension independently.
	// +optional
	Extensions map[string]string `json:"extensions,omitempty"`
}

CloudEventOverrides defines arguments for a Source that control the output format of the CloudEvents produced by the Source.

func (*CloudEventOverrides) DeepCopy added in v0.8.1

func (in *CloudEventOverrides) DeepCopy() *CloudEventOverrides

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

func (*CloudEventOverrides) DeepCopyInto added in v0.8.1

func (in *CloudEventOverrides) DeepCopyInto(out *CloudEventOverrides)

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

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, og apis.Immutable) *apis.FieldError

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) GetGroupVersionKind

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

GetGroupVersionKind returns the GroupVersionKind.

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

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 {
	// Secret is the credential to use to create and poll the PullSubscription
	// Subscription. 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).
	// +optional
	Secret *corev1.SecretKeySelector `json:"secret,omitempty"`

	// Project is the ID of the Google Cloud Project that the PullSubscription
	// Topic exists in.
	// +optional
	Project string `json:"project,omitempty"`

	// 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"`

	// Sink is a reference to an object that will resolve to a domain name or a
	// URI directly to use as the sink.
	Sink v1alpha1.Destination `json:"sink"`

	// 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 *v1alpha1.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"`

	// CloudEventOverrides defines overrides to control modifications of the
	// event sent to the sink.
	// +optional
	CloudEventOverrides *CloudEventOverrides `json:"ceOverrides,omitempty"`
}

PullSubscriptionSpec defines the desired state of the PullSubscription.

func (*PullSubscriptionSpec) DeepCopy

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 {
	// inherits duck/v1beta1 Status, 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.
	duckv1.Status `json:",inline"`

	// SinkURI is the current active sink URI that has been configured for the
	// PullSubscription.
	// +optional
	SinkURI string `json:"sinkUri,omitempty"`

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

	// ProjectID is the resolved project ID in use by the PullSubscription.
	// +optional
	ProjectID string `json:"projectId,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

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

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

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) MarkDeploying

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

MarkDeploying sets the condition that the source is deploying.

func (*PullSubscriptionStatus) MarkEventTypes

func (s *PullSubscriptionStatus) MarkEventTypes()

MarkEventTypes sets the condition that the source has created its event types.

func (*PullSubscriptionStatus) MarkNoEventTypes

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

MarkNoEventTypes sets the condition that the source does not its event types configured.

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 string)

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

func (*PullSubscriptionStatus) MarkSubscribed

func (s *PullSubscriptionStatus) MarkSubscribed()

MarkSubscribed sets the condition that the subscription has been created.

func (*PullSubscriptionStatus) MarkSubscriptionOperation

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

MarkSubscriptionOperation sets the condition that the subscription is being operated on.

func (*PullSubscriptionStatus) MarkTransformer

func (s *PullSubscriptionStatus) MarkTransformer(uri string)

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, og apis.Immutable) *apis.FieldError

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) 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 {
	// 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 {
	// inherits duck/v1beta1 Status, 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.
	duckv1.Status `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) 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) MarkDeployed

func (ts *TopicStatus) MarkDeployed()

MarkDeployed sets the condition that the publisher has been deployed.

func (*TopicStatus) MarkDeploying

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

MarkDeploying sets the condition that the publisher is deploying.

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) MarkNotDeployed

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

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

func (*TopicStatus) MarkPublisherNotOwned

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

func (*TopicStatus) MarkTopicOperating

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

MarkTopicOperating sets the condition that the topic is currently involved in an operation.

func (*TopicStatus) MarkTopicReady

func (ts *TopicStatus) MarkTopicReady()

MarkTopicReady sets the condition that the topic has been created.

func (*TopicStatus) PropagatePublisherStatus

func (ts *TopicStatus) PropagatePublisherStatus(ready *apis.Condition)

func (*TopicStatus) SetAddress

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

TODO: Use the new beta duck types.

Jump to

Keyboard shortcuts

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