wasm-nats-sqldb-sync/wadm.yaml
Lorenzo Venerandi d573f07c98 project init
2025-01-07 23:01:06 +01:00

87 lines
2.7 KiB
YAML

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: go-sqldb-sync
annotations:
description: 'Webassembly component that syncs a NATS topic data to a database table (Postgres)'
wasmcloud.dev/authors: Lorenzo Venerandi
wasmcloud.dev/source-url: https://gitea.rebus.ninja/lore/wasm-nats-sqldb-sync.git/wadm.yaml
wasmcloud.dev/readme-md-url: https://gitea.rebus.ninja/lore/wasm-nats-sqldb-sync.git/README.md
wasmcloud.dev/homepage: https://gitea.rebus.ninja/lore/wasm-nats-sqldb-sync.git
wasmcloud.dev/categories: |
sqldb,postgres,nats-client,tinygo,golang
spec:
components:
- name: go_sqldb_sync
type: component
properties:
image: gitea.rebus.ninja/lore/wasm-nats-sqldb-sync:1.0.0
id: producer
# config:
# - name: nats-topic
# properties:
# dest-topic: wasmcloud.echo.reply
traits:
- type: spreadscaler
properties:
instances: 1
spread:
- name: cloud
weight: 0
requirements:
host-type: cloud
- name: edge
weight: 100
requirements:
host-type: edge
- type: link
properties:
target:
name: sqldb-postgres
config:
- name: default-postgres
namespace: wasmcloud
package: postgres
interfaces: [query]
# Add a capability provider that implements `wasmcloud:messaging` using NATS
- name: nats-producer
type: capability
properties:
image: ghcr.io/wasmcloud/messaging-nats:0.23.1
traits:
- type: link
properties:
target: go_data_producer
namespace: wasmcloud
package: messaging
interfaces: [handler]
source_config:
- name: simple-subscription
properties:
subscriptions: producer
- type: spreadscaler
properties:
instances: 1
spread:
- name: cloud
weight: 0
requirements:
host-type: cloud
- name: edge
weight: 100
requirements:
host-type: edge
- name: sqldb-postgres
type: capability
properties:
image: ghcr.io/wasmcloud/sqldb-postgres:0.7.2
config:
- name: default-postgres
properties:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DATABASE: postgres
POSTGRES_TLS_REQUIRED: false