[GCP PubSub] Adds Component Metadata Schema (#3057)

Signed-off-by: robertojrojas <robertojrojas@gmail.com>
Signed-off-by: Roberto Rojas <robertojrojas@gmail.com>
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
This commit is contained in:
Roberto Rojas 2023-08-14 17:06:47 -04:00 committed by GitHub
parent 5d6ee65d26
commit 01646b8833
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 77 additions and 12 deletions

View File

@ -15,18 +15,20 @@ package pubsub
// GCPPubSubMetaData pubsub metadata.
type metadata struct {
ConsumerID string `mapstructure:"consumerID"`
Type string `mapstructure:"type"`
IdentityProjectID string `mapstructure:"identityProjectID"`
ProjectID string `mapstructure:"projectID"`
PrivateKeyID string `mapstructure:"privateKeyID"`
PrivateKey string `mapstructure:"privateKey"`
ClientEmail string `mapstructure:"clientEmail"`
ClientID string `mapstructure:"clientID"`
AuthURI string `mapstructure:"authURI"`
TokenURI string `mapstructure:"tokenURI"`
AuthProviderCertURL string `mapstructure:"authProviderX509CertUrl"`
ClientCertURL string `mapstructure:"clientX509CertUrl"`
// Ignored by metadata parser because included in built-in authentication profile
ConsumerID string `mapstructure:"consumerID" mdignore:"true"`
Type string `mapstructure:"type" mdignore:"true"`
IdentityProjectID string `mapstructure:"identityProjectID" mdignore:"true"`
ProjectID string `mapstructure:"projectID" mdignore:"true"`
PrivateKeyID string `mapstructure:"privateKeyID" mdignore:"true"`
PrivateKey string `mapstructure:"privateKey" mdignore:"true"`
ClientEmail string `mapstructure:"clientEmail" mdignore:"true"`
ClientID string `mapstructure:"clientID" mdignore:"true"`
AuthURI string `mapstructure:"authURI" mdignore:"true"`
TokenURI string `mapstructure:"tokenURI" mdignore:"true"`
AuthProviderCertURL string `mapstructure:"authProviderX509CertUrl" mdignore:"true"`
ClientCertURL string `mapstructure:"clientX509CertUrl" mdignore:"true"`
DisableEntityManagement bool `mapstructure:"disableEntityManagement"`
EnableMessageOrdering bool `mapstructure:"enableMessageOrdering"`
MaxReconnectionAttempts int `mapstructure:"maxReconnectionAttempts"`

View File

@ -0,0 +1,63 @@
# yaml-language-server: $schema=../../../component-metadata-schema.json
schemaVersion: v1
type: pubsub
name: pubsub.gcp.pubsub
version: v1
status: stable
title: "GCP Pub/Sub"
urls:
- title: Reference
url: https://docs.dapr.io/reference/components-reference/supported-pubsub/setup-gcp-pubsub/
capabilities: []
builtinAuthenticationProfiles:
- name: "gcp"
metadata:
- name: orderingKey
description: |
The key provided in the request. Its used when enableMessageOrdering
is set to true to order messages based on such key.
type: string
example: '"my-orderingkey"'
- name: enableMessageOrdering
description: |
When set to "true", subscribed messages will be received in order,
depending on publishing and permissions configuration.
type: bool
default: 'false'
example: '"true", "false"'
- name: disableEntityManagement
description: |
When set to "true", topics and subscriptions do not get created automatically.
type: bool
default: 'false'
example: '"true", "false"'
- name: maxReconnectionAttempts
description: |
Defines the maximum number of reconnect attempts.
type: number
default: '30'
example: '30'
- name: connectionRecoveryInSec
description: |
Time in seconds to wait between connection recovery attempts.
type: number
default: '2'
example: '2'
- name: deadLetterTopic
description: |
Name of the GCP Pub/Sub Topic. This topic must exist before using this component.
type: string
example: '"myapp-dlq"'
- name: endpoint
description: |
GCP endpoint for the component to use. Only used for local development (for example)
with GCP Pub/Sub Emulator. The endpoint is unnecessary when running against the GCP production API.
type: string
example: '"http://localhost:8085"'
- name: maxDeliveryAttempts
description: |
Maximum number of attempts to deliver the message.
If "deadLetterTopic" is specified as well, "maxDeliveryAttempts" is the maximum number of attempts before messages are moved to the dead-letter queue.
type: number
default: '5'
example: '5'